I am using Rails 3 and devise and am trying to make it so that when a person comes to my web app, they are taken directly to the user registration sign_up link instead of the sign in link.
I’m pretty sure that I’m having this problem because my routes are configured like:
root :to => "babies#new"
Accessing the baby model requires a user to be logged in. To get around this I’ve tried changing this to:
root :to => “users#sign_up”
It doesn’t seem to work? I get an error saying that I have an:
uninitialized constant UsersController
Can anyone suggest what I’m doing wrong?
Thanks in advance!
One of the solutions is to create separate controller say
mainand an action in itsign_up_redirect. Then configure your routes file like this:and write in that action next:
* path to registration can be different to you