Forum: Ruby on Rails Re: ", '@item') %> (working on it)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5f699f59b58693ce313995caf4330486?d=identicon&s=25 (Guest)
on 2005-11-24 14:53
(Received via mailing list)
ok, so I'm playing with the source now and have gotten this working
(at least on the output side of things).

So my example of:
<% for @order in @orders %>
 <%= text_field("order[]", 'name') %>
 <% for @item in @order.items %>
   <%= text_field("order[]item[]", 'name') %>

yeilds something like this:
  <input type="text" name="order[1][name]" ...
  <input type="text" name="order[1]item[1][name]"...
  <input type="text" name="order[2][name]" ...
  <input type="text" name="order[2]item[1][name]"...
  <input type="text" name="order[2]item[2][name]"...

Before I start working on loading this back into model objects upon a
submit, does anyone have any thoughts on this approach?  This
functionality wasn't left out for any particular reason, was it?

This topic is locked and can not be replied to.