I want to have a form with which the user can choose options (meal
choices) for themselves and a number of 'dinner companions'. The
number is pre-specified in a different form. I have an attendee model,
and a 'diner' model which has an attendee_id field, and a
'diner_number' field - so if the attendee wants to have 2 companions
the diner id's would be 0 for the attendee themselves, and 1, 2 for
the companions. I wanted to do this so that there was no way to
submit choices for anyone elses dinner.
The problem is, I'm not sure how to get this working properly - I have
it set up to make a number of entry options in the form, each with the
index set to 0, 1, 2...., but it's how to a) make these work with
newly created objects, so that they have the correct defaults upon
form creation, and secondly how to process this data in the controller
upon submission - and have validation working properly.
Does this make sense, and any thoughts?