Authentication in ruby on rails from scratch