Module: Devise::Controllers::Helpers

Defined in:
lib/devise/monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

Method used by sessions controller to redirect user after a magic link is sent from the sign in page. You can overwrite it in your ApplicationController to provide a custom hook for a custom scope.

By default it is the root_path.



74
75
76
77
78
79
# File 'lib/devise/monkeypatch.rb', line 74

def after_magic_link_sent_path_for(resource_or_scope)
  scope = Devise::Mapping.find_scope!(resource_or_scope)
  router_name = Devise.mappings[scope].router_name
  context = router_name ? send(router_name) : self
  context.respond_to?(:root_path) ? context.root_path : "/"
end