我在 Rails 3 中使用设计进行身份验证。通过在我的应用程序的 lib 文件夹中创建一个名为 custom_failure.rb 的文件并在 application.rb 中添加一些代码,我能够在登录到主页后重定向用户。以下是我的 custom_failure.rb 代码
class CustomFailure < Devise::FailureApp
def redirect_url
root_path
end
def respond
if http_auth?
http_auth
else
redirect
end
end
end
以下是 application.rb 代码
config.autoload_paths += %W(#{config.root}/lib)
请通过指定我应该覆盖哪个重定向功能来帮助我,以便在发送重置密码邮件后将用户重定向到登录页面。谢谢