[英]Devise not redirecting to specific location after sign UP
我一直在嘗試使Devise在注冊后將我的Rails應用重定向到profile_new_path位置。
到目前為止,我已經...
按照https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-(registration)上 Devise文檔中的說明進行操作
@ app / controllers / registrations_controller.rb
def after_sign_up_path_for(resource)
"/profiles/new"
end
我嘗試使用new_profile_path ,將參數“ resource”更改為“ user”和“ profile”
我試過在application_controller.rb中添加相同的方法
似乎無論我做什么設計都會將我重定向到profile_path,這是我在application_controller.rb中登錄后指定要定向的路徑
任何人都可以提供有關在sign_up之后如何重定向到特定路徑的幫助。 我真的很感激。
嗨,您是否將此添加到您的route.rb中,
devise_for :users, controllers: { registrations: "registrations" }
希望這對您有幫助。
我使用了類似的方法,首先將其重定向到welcome控制器,然后根據用戶授權將其重定向到特定頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.