views:

687

answers:

2

I need the form that will edit the array of entities and their related entities(one to many). Like this: Person has many Orders. Form for array of People with their orders.

What rails API can be used to build this form? Please give a code sample.

+1  A: 

You want to check out nested_attributes_for in Rails 2.3

http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes

mylescarrick
+3  A: 

Check out the following tutorials:

  1. Edit Multiple Railscast
  2. Nested Object Form
Simone Carletti