Method: Devise::Controllers::StoreLocation#store_location_for
- Defined in:
- lib/devise/controllers/store_location.rb
#store_location_for(resource_or_scope, location) ⇒ Object
Stores the provided location to redirect the user after signing in. Useful in combination with the ‘stored_location_for` helper.
Example:
store_location_for(:user, dashboard_path)
redirect_to
36 37 38 39 40 41 |
# File 'lib/devise/controllers/store_location.rb', line 36 def store_location_for(resource_or_scope, location) session_key = stored_location_key_for(resource_or_scope) path = extract_path_from_location(location) session[session_key] = path if path end |