Sharon Machlis
2008-Apr-17 21:46 UTC
Having problem with validates_presence_of fields in form when trying to also use ActiveScaffold (x-posted at ActiveScaffold group)
I have an events listing site that includes the models Event and DateAndTime, so an event that happens more than once (like a high school play) can have more than one date_and_time. The Event model has_many date_and_times, and the DateAndTime model belongs_to event. The Event model validates_presence_of two submission form variables, the_date and the_time, and those variable values then get used to create a new date_and_time object once the form is submitted. My ActiveScaffold problem is that when the update form for the Event model displays, it shows all the correct dates and times in drop-down lists (with the ability to either edit or delete them) PLUS an *extra* date and time field that''s set by default to the current date and time, with no way to delete that field. The update form is created with this new additional date field required, even though the event object already has other date_and_time objects associated with it. Any ideas how I can make my Event update form display without the new date and time non-deletable field in ActiveScaffold, while still requiring date and time submissions on the public site''s Event creation form? Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---