1
是否可以检查在:password
字段中输入的内容是否与模型中的:current_password
字段不相同?模型验证
喜欢的东西
validates :current_password, :format => { :with => :password, :message => "Current password can't be the same as the password" }
不工作是什么写它的正确方法吗?
不工作,它是如何检查:current_password? ,我只是想确保他们放入current_password字段的内容与密码字段不同,并给出错误信息,说明它们不能相同 – ahmet
密码是如何存储的? (希望不是)纯文本,MD5/SHA哈希,还是使用Bcyrpt? (这个例子假设你正在使用Bcrypt。) –
不知道我在使用设备 – ahmet