Class: ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ApplicationController
- Includes:
- Exceptions, Pundit
- Defined in:
- app/controllers/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#user_not_authorized(exception) ⇒ Object
rescue_from Exception, with: :handle_all_errors rescue_from Exceptions::WhatAnError do |e| flash = e.message redirect_to root_url end.
Instance Method Details
#user_not_authorized(exception) ⇒ Object
rescue_from Exception, with: :handle_all_errors rescue_from Exceptions::WhatAnError do |e|
flash[:error] = e.
redirect_to root_url
end
private
38 39 40 41 42 43 |
# File 'app/controllers/application_controller.rb', line 38 def (exception) # policy_name = exception.policy.class.to_s.underscore # flash[:error] = t '.not_authorized' redirect_to(request.referrer || "/pages/error") end |