![](/img/trans.png)
[英]How to redirect a page on successful sign in rails devise and after verify user== “teachers”
[英]How to redirect to a specific page on successful sign up using rails devise gem?
如何使用rails devise gem成功注冊時重定向到特定頁面?
我希望它為時已晚,您需要覆蓋注冊控制器的after_sign_up_path_for,在您的app / controller中創建registrations_controller.rb,並覆蓋所述操作。
registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
def after_sign_up_path_for(resource)
...path of choice...
end
end
尚未測試此代碼,因此可能無法復制和粘貼。 如果您在此處查看,它將為您提供所需的任何其他重定向的操作。
最近移動了wiki頁面,信息在這里: https : //github.com/plataformatec/devise/wiki/How-To : -Redirect- to-a-specific-page-on-successful- sign-in-and-登出
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.