Ruby on Rails Authlogic gem - Password confirmation
Following the http://github.com/binarylogic/authlogic_example how would I change it so that password confirmation is required for everything (such as for the edit user, and password reset pages) except for the registration page?
I'd like the registration page to only require an email, a password 开发者_运维问答and a captcha. I only want password confirmation for the edit user page and password reset page.
Something like:
#user.rb
attr_accessor :password_confirmation
def validate
errors.add(:password_confirmation, "Passwords don\'t match") if ! valid_password?(password_confirmation)
end
精彩评论