On 28.02.2012, at 19:34, Esti Alvarez wrote:

> I'm having the same problem. Did you manage to solve it?
> 

1) 
http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
2) If nothing happens, customize view code:

"_member_fields.html.erb":
    <%= builder.label: name %>
    <%= builder.text_field: name %>

    <%= builder.label: Instrument %>
    <%= builder.text_field: Instrument %>

"_form.html_erb":
<% if @band.new_record? %>
  <% f.fields_for :members_attributes do |member_form| %>
      <%= render "member_fields, :builder => member_form %>
  <% end %>
<% else %>
  <% @band.members.each.with_index do |index, member| %>
   <% f.fields_for member, "members_attributes[#{index}]" do |member_form| %>
      <%= render "member_fields, :builder => member_form %>
   <% end %>
 <% end %>
<% end %>


I could write something inaccurate, but like that.

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