I think what your looking for is the index attribute on your form
fields:
<% form_for :resourece do |form| %>
<% resourece.sub_resources.each do |sr| %>
<% fields_for :sr, sr do |sr_fields| %>
<%= sr_fields.text_field :name, :index => sr.id %>
<% end %>
<% end %>
<% end %>
then the params will be sent to the controller like so:
sub_resource[i][:name]
where "i" is the index set in the above field
something like that anyway... hope that sets you on the right track...
you may want to search around the group a bit more I know there has
been discussions on this.
good luck!
Tim
On Oct 29, 9:33 am, John Small
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Does anyone know of some examples of simple forms using nested
> resources?
>
> I want to have a parent record, with many child records all on the one
> form, and have all the add, edit, delete etc methods available on the
> children.
>
> This seems to be an obvious use for the nested routes that are generated
> by nested resources so I assume someone has this all worked out
> somewhere. Or is it so obvious that no explanation is required?
>
> Thanks
>
> John Small
> --
> Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---