How can I create an after-confirmation redirect in Devise?
Before I added the confirmation module the custom after_sign_up_path worked fine for the first time login/signup but now when I click the confirmation link in the email it redirects to the path I set for the after-login path (user profile).
My goal is to create a form wizard and “getting started” page to collect additional information. The obvious caveat being that this redirect will only happen one time, upon confirmation.
I tried some other solutions that have been posted on Stack Overflow but none of them seem to work any longer.
Essentially, you want to change around line 25 of Devise’s
ConfirmationsController.This means you need to override the
showaction modifying the “happy path” of thatifstatement in theshowaction to your heart’s content:And a scoped route for it (I put the view and action in the registrations controller but you can change it to whatever):
The default
showaction is referring to the protectedafter_confirmation_path_formethod, so as another option, you could just modify what that method returns.