gpt4 book ai didi

ruby-on-rails - 如果用户未登录设备,则重定向到注册页面

转载 作者:行者123 更新时间:2023-12-04 07:39:44 26 4
gpt4 key购买 nike

从阅读设计代码和 wiki 看来,如果用户未登录,则无法将用户重定向到注册页面。在 lib/devise/failure_app.rb 中,重定向 url 似乎是硬编码的。

  def redirect_url
opts = {}
route = :"new_#{scope}_session_path"
opts[:format] = request_format unless skip_format?

if respond_to?(route)
send(route, opts)
else
root_path(opts)
end
end

我想问这是完成工作的最佳实践。我正在考虑手动设置 user_return_to session 值,然后调用注册页面。这是一个好习惯吗?

最佳答案

关于ruby-on-rails - 如果用户未登录设备,则重定向到注册页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8005510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com