I have an action named ‘login’ that shows the login form.
The form posts to the ‘signin’ action.
I haven’t implemented the authentication logic yet, so I tried this:
def signin
redirect_to login
end
So when the login form posts, it just redirects back to the login page again.
Cannot redirect to nil!
but its not working, why?
You almost had it
Good for you for trying to build your own authentication system. But if you do eventually plan on going to production, please consider using an established authentication system (such as Devise) unless you REALLY know what you’re doing, and know all the security issues like the back of your hand. Get started here http://guides.rubyonrails.org/security.html