views:

25

answers:

1

I have a class with a date. If the user doesn't change it in the view, Rails saves today's date (the default values in the drop downs). I would like it to be saved as a null value instead. How do I do this?

A: 

You can use :include_blank in your date_select helper. Reference: http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002264

Brian
Man you guys are quick and man am I stupid. Thanks a lot!
fiskeben
No problem. Everybody needs to start somewhere - don't be so hard on yourself.
Brian