Hanan Y. wrote in post #960326:
> Hi all,
> i'v been trying to understand how can i add more then one record to the
> DB from a form in a single shot so to say..
> I have an ITEM module, it has an ItemID and TYPEofItem , the TypeofItem
> is been selected from a dropdown list that populates the item types i
> have in another module *(called Types)..
> I have everything working nicly and i am adding the ItemID with no
> problem,
> but! i am trying to understand if i can type in more then one ItemID
> (with the same ItemType value) and submitting them all at once to the
> DB..
> Maby crating a list object (i have no idea on how to do that in the
> view..) and filling out rows with differnt ID's and then running on the
> list and adding them all...
> Can someone please help me understand how to do that ? - thank's...

You want to use accepts_nested_attributes_for.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

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

Reply via email to