Ruby on rails rails活动型号密码\u确认不起作用
我有以下型号:Ruby on rails rails活动型号密码\u确认不起作用,ruby-on-rails,activerecord,formtastic,password-confirmation,Ruby On Rails,Activerecord,Formtastic,Password Confirmation,我有以下型号: class Client < ActiveRecord::Base attr_accessible :email, :mobile, :notifications_option, :password, :password_confirmation, :promotion_code validates_format_of :password, :with => /^(?=.*[^a-zA-Z])(?=.*[0-9])\S{8,}$/, :message
class Client < ActiveRecord::Base
attr_accessible :email, :mobile, :notifications_option, :password, :password_confirmation, :promotion_code
validates_format_of :password, :with => /^(?=.*[^a-zA-Z])(?=.*[0-9])\S{8,}$/, :message => "Your password must be at least 8 characters long containing at least 1 number"
validates_confirmation_of :password
end
我在哪里提出@client.inspect并知道我的密码和密码确认是相同的值。但我一直在
"doesn't match confirmation"
我已经尝试了所有的方法,但是没有成功,我正在使用rails 3.1.18和formtastic 您是否检查过
:密码\u确认是否为零?我检查过。我后来发现原因是因为我已经编写了自己的password=和password方法,因此无法使用!
"doesn't match confirmation"