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
same time.

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).

http://pastie.org/655276

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.

Here are my two debug(params)
http://pastie.org/655301
http://pastie.org/655304


Thanks for any help,
~Jeremy
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to