Forum: Ruby on Rails date_select validate all fields selected

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ebaf11f80be493ae0daf6aa7169ac45c?d=identicon&s=25 _thief_ (Guest)
on 2009-05-26 23:15
(Received via mailing list)
Hi,

date_select seems to behave rather strangely if :prompt => true
or :empty => true and the user does not select all fields.

It seems that by the time the birth_date field gets to validation, its
filled with a Date object that has defaults set for empty fields. eg
If a year is selected but month and day are not, then month and day
are set to january 1st. This is really not intuitive but I'm still new
to rails (made the move from CakePHP at last!) - maybe I'm doing
something wrong.

Is there a best practice here that I don't know about?

Thanks!
This topic is locked and can not be replied to.