Class: ActionDispatch::ActionableExceptions
- Inherits:
-
Object
- Object
- ActionDispatch::ActionableExceptions
- Defined in:
- lib/action_dispatch/middleware/actionable_exceptions.rb
Overview
:nodoc:
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ActionableExceptions
constructor
A new instance of ActionableExceptions.
Constructor Details
#initialize(app) ⇒ ActionableExceptions
Returns a new instance of ActionableExceptions.
10 11 12 |
# File 'lib/action_dispatch/middleware/actionable_exceptions.rb', line 10 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/action_dispatch/middleware/actionable_exceptions.rb', line 14 def call(env) request = ActionDispatch::Request.new(env) return @app.call(env) unless actionable_request?(request) ActiveSupport::ActionableError.dispatch(request.params[:error].to_s.safe_constantize, request.params[:action]) redirect_to request.params[:location] end |