I want my users to be able to change their password.
I wrote the code below but I need help to add error if the old password
he posted did not match the current password he have.
In the controller I have:
return true unless request.post?
@user = current_user
and in my model:
if self.password == User.encrypt(password)
PS: I know I should use @user.errors.add("", “Old password is wrong”),
but where should I place it in my code?
I tried within check_password but this is not working
I appreciate any help