user authorisation tutorial from http://www.sitepoint.com/rails-userpassword-authentication-from-scratch-part-i/