I'm using the rails scaffolding with SQL Server. Even though my date fields are defined as nullable, there seems to be no way to set them to Null in the Edit\Create scaffold forms. The nullable fields display find in the list and show forms .. However, the EDIT\Create functions defaults the "Null" dates to todays date, and force me to ovewrite the null date whenever I update the form. I've tried this with standard "Scaffold" as well as "Scaffold_extension" and the behavior is the same. The "Options" in the RDOC (for the select_tag) don't mention how to include the "Null" option on the list. I my case, I have a column called "Removed_Date" .. and if the items is never removed, it should be null ... I considered adding an addtional "Removed_Indicator" .. However, if I did have that . the fact that the removed date is entered would be ambigious... The date should be NULL .. I really just need a way with scaffolding to set the date to Null ... Any Ideas ?
on 2007-03-05 04:43
on 2007-03-05 12:58
LitFuse wrote: > I'm using the rails scaffolding with SQL Server. Even though my date > fields are defined as nullable, there seems to be no way to set them > to Null in the Edit\Create scaffold forms. Correct. Time to go past scaffolding <http://www.slash7.com/articles/2005/12/7/the-fall-.... Unfortunately it seems the standard date/time helpers don't support null values, so you might have to roll your own. -- Jakob Skjerning - http://mentalized.net