I want my date fields to default to NIL or “”, because the presence of a
date means something. My problem is that rails is defaulting the fields
to today’s date automatically when I create a new record through the
scaffold. I tried removing the default ‘0000-00-00’ and changing NOT
NULL to NULL, but both columns get today’s date as the default (see
below for the table’s sql syntax).
So it looks like I need to code something, but I’m unsure to put that in
the model or in the view (or if this is a form helper deal). Any help
is appreciated. Thank you in advance!
CREATE TABLE volunteers ( …other columns…
birthdate date default NULL,
competency_in_service_on date NOT NULL default ‘0000-00-00’
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;