Method: Flail::Rails::ControllerMethods#inject_flail_data_into_environment
- Defined in:
- lib/flail/rails/controller_methods.rb
#inject_flail_data_into_environment ⇒ Object
This method is inserted into the host application’s controllers as a before_filter and is used to pass the parameters, session data, user data, and URL data from the app’s controller to the flail gem via the env variable (data is always passed, even if no exception is thrown). This hook only works when a host app’s controller is called. Routing error exceptions are thrown before the controller is called so those errors are handled elsewhere and contain less information (mainly the user data is missing).
21 22 23 24 |
# File 'lib/flail/rails/controller_methods.rb', line 21 def inject_flail_data_into_environment request.env['flail.request'] ||= request request.env['flail.request.data'] ||= flail_request_data end |