Day 37 – Rails cont.
I guess the day count is weird – just days of actual class in the 9 weeks. It’s been so many more days than that. Anyway, I’m still going with Rails… It’s definitely starting to come together. After much struggling… I’m currently working on building user registration and login. Again. I think this is the 3rd time? First with straight PHP and for “the wall”, then again with CodeIgniter, and now with Rails. Interesting to do the same task different ways and compare. Each has its own methods of validation, password encryption, error messages, etc. At this point the whole login validation thing is old hat.
- Check if the username (or email address) field on the login form is blank and if so display an error message saying so.
- Otherwise, check if the username exists in the database and if not display an error message saying so.
- Otherwise if the username exists in the database check if the password matches and if not display an error message saying so.
- Otherwise if the username and password match then all is well and log the user in!
Whee. Wanna see what that looks like? It occurs to me that I’ve never posted any actual code on this blog. Here!:
(Look at all the pretty colors!) :-)