I'm fairly new to rails and not sure how to handle this situation. I'm
trying to allow the user to create a meeting, add as many locations for
the meeting as they'd like, then add as many dates for each of those
locations as they'd like in a wizard style form.
I have the first piece working correctly, the user can create the
meeting and add as many locations as they like using fields_for the
locations (meeting has many locations).
What I'm struggling with is how do I then allow them to add several
dates for each location. Adding a date is really creating an object that
has a meetingID, a locationID, and two date fields.
A few questions:
1) It seems to me the first piece (creating the meeting and its children
locations) will have to be one action (create method in the meeting
controller) so that the new location IDs will be available in order to
facilitate adding dates for each location is that correct?
2) If that is is the case, what controller/action should adding the
dates for each location be in? Another action in the meeting controller?
Or in the date controller?
3) Any other advice/guidance is much appreciated!