Have you found any answer for this? Not being able to save on models with dates while using the calendar date select gem is kind of a roadblock...
On Mar 8, 3:02 pm, BillSaysThis <[email protected]> wrote: > I'd rather not mess with the meeting_date field in the > before_create_save, I'm just trying to get around that meeting_date > cannot be null error. > > On Mar 8, 2:21 pm, Kenny Ortmann <[email protected]> wrote: > > > I'm gonna look into theoptionsnot working tomorrow and see if I can figure > > out what's going on. > > > What are you trying to do with the meeting date in the before_create_save > > method?? You shouldn't have to touch the model, rails handles parsing the > > date back out of the params when you pass the params to the model. > > > On Sun, Mar 8, 2009 at 1:59 PM, BillSaysThis <[email protected]> wrote: > > > > How is the calendar_date_select_value accessed in a before_create_save > > > method? (I get the same error if there's no before_create_save method > > > too.) > > > > Code: > > > > (from the controller config block) > > > > config.columns[:meeting_date].options= {:start_year => > > > 0.years.from_now, :end_year => 3.years.from_now} > > > > def before_create_save(record) > > > # March 10, 2009 > > > md = record.meeting_date > > > sd = md.split(%r{,\s*}) > > > sdd = Date.new(sd.last, Date::MONTHNAMES.index(sd.second), > > > sd.first) > > > record.meeting_date = sdd > > > end > > > > Error I get: > > > > Mysql::Error: Column 'meeting_date' cannot be null: UPDATE `meetings` > > > SET `meeting_date` = NULL ... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
