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