I'm doing something that seems so simple, but I can't figure it out.
I'm writing a change password function for the "my account" section of
a site. I want the user to enter their old password and their new
password (and a confirmation), and then check that the old password
matches before updating the record.
However, I don't know how to keep the old password around in order to
do the validation. Because the validations happen in the model, the
attributes are wiped out when assigning the new password value to the
I have to admit that I'm having trouble with validations generally.
Database stuff is fine and relatively easy, but anything not backed by
the database and I'm at a loss.
Does this make sense? How do you handle this?