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.

  1. Check if the username (or email address) field on the login form is blank and if so display an error message saying so.
  2. Otherwise, check if the username exists in the database and if not display an error message saying so.
  3. Otherwise if the username exists in the database check if the password matches and if not display an error message saying so.
  4. 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!:

login

(Look at all the pretty colors!)  :-)

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: