Ruby on Rails Authlogic gem - Password confirmation

894 views Asked by At

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.

1

There are 1 answers

0
mark On

Something like:

#user.rb
attr_accessor :password_confirmation

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