Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
devise のサインアップ フォームが 2 つあり、ユーザーが使用したサインアップ フォームに応じて、登録時にユーザーを 2 つの異なるページにリダイレクトしたいと考えています。これを達成するための最良の方法は何ですか?
application_controller.rb に追加してみてください:
def after_sign_up_path_for(user) user.something? ? dashboard_path : root_path end
これでうまくいくかどうかはわかりませんが、うまくいかない場合は上書きできますDevise::RegistrationsController。
Devise::RegistrationsController