[Rails] Change password

Mohit Sindhwani
Mon, 14 Aug 2006 14:09:00 -0000

Is there an addition to the Rails Recipe or the method in AWDWR to allow
a user to change his/ her password?  I have put something together that
does all the work again - mostly because I''m not sure how to leverage
on
methods like ''password='' that are defined in the model.  Has
anyone got
a ready sample that I could learn from?

Right now, I''m basically examining the parameters from the form POST to
find the user, verify his current password is correct.  Then, I manually
confirm that the new password and password_confirmation match - finally,
I create a hashed password and save it to the database using
update_attribute.

There MUST be a simpler way.. help, anyone?

Thanks,
Mohit.