Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #265 from MYDRY/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rkdora authored Feb 3, 2019
2 parents f4f5af7 + 9d66cf8 commit f57a1ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ class ApplicationController < ActionController::Base
include Jpmobile::ViewSelector
include UsersHelper

rescue_from ActiveRecord::RecordNotFound, with: :render_404
rescue_from ActionController::RoutingError, with: :render_404

def render_404
flash[:danger] = 'そのページは存在しません'
redirect_to root_path
end

def authorize
unless logged_in?
flash[:info] = 'ログインしてください'
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@
resources :random_words_ideas
resources :mandal_ideas
resources :seas

get '*path' => 'application#render_404'
end

0 comments on commit f57a1ae

Please sign in to comment.