开发者

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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜