Topo
Topo

Reputation: 1364

Devise on Rails 3: How to override the message a user already signed in gets when trying to sign up?

The situation is the following, using Devise and Rails 3

How do I set up different messages in the two cases above?

Upvotes: 2

Views: 992

Answers (1)

Topo
Topo

Reputation: 1364

Ok, I figured out the followings:

  • This behaviour is caused by the registration controller, which has a prepend_before_filter that triggers a call to require_no_authentication. Require_no_authentication simply redirects to root_url if the user is logged in

  • There is an open ticket on github, since it's quite difficult to override the method (see here: Devise issues

  • Nevertheless, as pointed out by Jose' Valim on the same page, it doesn't make much sense to show to a logged in user the sign up link... I'll modify the interface of my application to hide the signup link if the user is logged in.

Upvotes: 1

Related Questions