Question

I'm using Devise on Rails 3.

And whenever user signs up, they got confirmation email.
After signing up, they redirected to login page, but it shows You need to sign in or sign up before continuing. unauthenticated message.

I want to customize this message like Thank you for signing up, please confirm your account. after signing up..

Any ideas???

Was it helpful?

Solution 2

you can set a custom flash[:notice] or flash[:alert] in your controller method, probably in the registrations controller on the create action.

OTHER TIPS

If the message is "You need to sign in or sign up before continuing" then after the signup its not redirecting to login, but to another location that needs authentication (which user clearly doesn't have... so he gets redirected to the sign in path) so the message is displaying correctly.

What you could do is, first, modify the after_sign_up_path and/or the after_sign_in_path to redirect to the action you want (e.g. home#index or something like that). See devise documentation about this item.

Second: for a custom message with special instructions you should use the flash hash.

Also, you can customize all devise messages in locales/devise.en.yml (or create translations), but I believe this is not what you want. The devise message was correctly displayed, because the user needed authentication. Be sure to track the controller/actions trace to find out why the user needed the authentication.

Hope it helps. Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top