我有以下驗證:軌密碼更新驗證問題
validates :password, :presence => true, :confirmation => true, :length => { :within => 6..40 }, :format => { :with => pass_regex }, :unless => :nopass?
然後,當我嘗試無密碼更新(?NOPASS爲真)出現以下錯誤:
There were problems with the following fields:
Password is too short (minimum is 6 characters)
Password is invalid
注意:除非作品在:存在和:確認,但不在:長度或:格式。
我該如何解決這個問題?
這Rails的版本您使用? – Anatoly
我正在使用Rails 3.0.9 – mornaner