views:

46

answers:

1

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.

A: 

Something like:

#user.rb
attr_accessor :password_confirmation

def validate
  errors.add(:password_confirmation, "Passwords don\'t match") if ! valid_password?(password_confirmation)
end
mark