Rails rails 里面怎么判断两次输入的密码是否一致?

lin_style · April 17, 2012 · Last by lin_style replied at April 17, 2012 · 3148 hits

也是自己写个 JS 判断,还是 RAILS 有现成的功能?

使用 validates :password, :confirmation => true

validates :password, presence: { on: :create}, confirmation: { allow_blank: true }, length:{maximum:20,minimum:6}

谢谢大家帮助。回头试下

You need to Sign in before reply, if you don't have an account, please Sign up first.