ruby on rails - How to verify a user's password in Devise -
i'm having problem matching user password using devise gem in rails. user password stored on db encrypted_password , trying find user password, don't understand how match password form , encrypted_password in db.
user.find_by_email_and_password(params[:user][:email], params[:user][:password])
i think better, , more elegant way of doing it:
user = user.find_by_email(params[:user][:email]) user.valid_password?(params[:user][:password])
the other method generate digest user instance giving me protected method errors.
Comments
Post a Comment