Class: ActionDispatch::ActionableExceptions
- Defined in:
 - actionpack/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.
      12 13 14  | 
    
      # File 'actionpack/lib/action_dispatch/middleware/actionable_exceptions.rb', line 12 def initialize(app) @app = app end  | 
  
Instance Method Details
#call(env) ⇒ Object
      16 17 18 19 20 21 22 23  | 
    
      # File 'actionpack/lib/action_dispatch/middleware/actionable_exceptions.rb', line 16 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  |