开发者

Ruby on Rails Authlogic gem - Password confirmation

开发者 https://www.devze.com 2023-01-14 20:55 出处:网络
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) excep

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
0

精彩评论

暂无评论...
验证码 换一张
取 消