following the tutorial for RoR user authentication at http://www.codeproject.com/Articles/575551/User-Authentication-in-Ruby-on-Rails