I found this thread while searching for how to validate a string as a 
user's password in the controller, and was disappointed when I didn't 
find the answer.

I figured it out so I figured I'd post the answer for other people that 
do the same thing.

The User model get's a method valid_password? with :acts_as_authentic. 
So to test the password you would just do:

@current_user.valid_password? params[:old_password]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to