Hi All. First to start, please bare with me as I’m really confused on
all this and have been stuck for about a day now, so I’m not sure if I
will even be asking the right questions or not, but here goes.
I’m trying to create a Menu object and then assign a group of Day
objects to it. This part is working fine. Next I want to go and update
this Menu and all of the Day objects associated with it. I’ve watched
the railscast on complex forms, so it kind of makes sense to me, but
there are a few differences here. Each Day object has an associated Meal
object. The meals are already created, so all I’m trying to do is assign
a single Meal to a Day, then update the Menu and all of the days at the
Here is the code I have. (I have trimmed down a lot of what isn’t needed
for this, but I can provide more code if it will help).
The actual issue that I’m having is that when I update the menu, then
click edit again to edit a second time, I now have extra days. Where I
first started with 20, I will have an extra “x” amount where “x” is the
number of days that I updated. So if I update 6 days, then now I will
have 26 days total, but 6 of those days won’t be saved correctly because
they will be missing some info.
Thanks for any help,