1
我最近添加了一個出生日期字段到我的設計註冊頁面,並使用validates_timeliness來檢查它的日期是否正確。但是,如果日期空白,我會得到下面的錯誤,不知道如何解決它。添加日期到設計,現在得到錯誤
* Date of birth translation missing: en, activerecord, errors, models, user, attributes, date_of_birth, invalid_date
* Date of birth translation missing: en, activerecord, errors, models, user, attributes, date_of_birth, invalid_date
控制器
#validates_timeliness gem is used for validates_date
validates_date :date_of_birth, :before => lambda { 18.years.ago }, :before_message => "must be at least 18 years old"
validates_date :date_of_birth, :after => lambda { 106.years.ago }, :before_message => "Seriously, dude. You ain't that old."
validates_acceptance_of :terms_of_service, :accept => true
validates_presence_of :gender_id
在行動的形式,如果你需要看到它。 http://hangwith.me/account/register
完美,正是我所需要的。謝謝! – Jason 2010-11-06 19:04:02