I am using devise for authentication in Rails 3. I was able to redirect the user after signing in to the home page by creating a file named custom_failure.rb inside lib folder of my app and adding some code in application.rb. Following is my custom_failure.rb code
class CustomFailure < Devise::FailureApp
def redirect_url
root_path
end
def respond
if http_auth?
http_auth
else
redirect
end
end
end
Following is the application.rb code
config.autoload_paths += %W(#{config.root}/lib)
Please help me out by specifying which redirect function should I override in order to redirect the user to login page after the reset password mail is sent.Thanks
As suggested - https://stackoverflow.com/a/19402686/1125893 You can override after_sending_reset_password_instructions_path_for(resource_name)
in Devise::PasswordController
def after_sending_reset_password_instructions_path_for(resource_name)
root_path
end
#routes.rb
devise_for :users, :controllers => { :passwords => "passwords" }
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments