Hi everyone.

I'm in the process of learning RoR and I'm trying to create a basic log in system. I have managed to create the form and have queried the database. It also creates the session.

Now what I want to do is to check for the session. I want to put this in my login controller. If the session is already set I just want to return the user to their account page. If not I want it to show / deal with the form as normal.

Any ideas? I've tried a few if statements but can't seem to get it right.