sessions: add a helper to clear the stored return path
This commit is contained in:
parent
e39fd7b171
commit
e580d336e4
6 changed files with 65 additions and 8 deletions
10
app/controllers/devise/store_location_extension.rb
Normal file
10
app/controllers/devise/store_location_extension.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
module Devise
|
||||
# Useful helpers additions to Devise::Controllers::StoreLocation
|
||||
module StoreLocationExtension
|
||||
# Delete the url stored in the session for the given scope.
|
||||
def clear_stored_location_for(resource_or_scope)
|
||||
session_key = send(:stored_location_key_for, resource_or_scope)
|
||||
session.delete(session_key)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue