diff options
author | Rhenium <rhenium@rhe.jp> | 2014-03-13 18:51:49 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-03-13 18:51:49 +0900 |
commit | 2cea6a60d9e0e2fc90199084e5e99395e1b02964 (patch) | |
tree | 451459585087da621de963f72283e29863d47995 /app/controllers/application_controller.rb | |
parent | 7c392ca7735a36948515a392b544ace60a242838 (diff) | |
download | aclog-2cea6a60d9e0e2fc90199084e5e99395e1b02964.tar.gz |
refactor error handling
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 66eb4ca..eb27964 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,10 +1,16 @@ class ApplicationController < ActionController::Base + include ControllerErrorHandling + protect_from_forgery after_action :set_content_type_to_xhtml, :tidy_response_body helper_method :logged_in?, :current_user helper_method :authorized_to_show_user?, :authorized_to_show_user_best? + def routing_error + raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}" + end + protected def logged_in? !!session[:user_id] |