I’m trying to validate a date_select field. :include_blank is set to
true, and the default value is obviously blank on a new object.
Unfortunately, if a user only selects a day, and leaves the month and
year blank, then the date is accepted with default values of January
and 1901, respectively.
I’d rather not do any validation in the controller, but that’s the
only place I can think of doing it ( checking the validity of the date
based on the individual components dob(2i) and dob(1i) ).
I’m also having problems checking for the validity of the dates
themselves. If I try a date of, say, February 30th, Actioncontroller
just craps out with “1 error(s) on assignment of multiparameter
attributes”. It doesn’t get to stage of validating the date from the
model. How can I get around this? I’d rather not present my users with
a “PROGRAM BROKE!” error.