multiple fields_for, same model

I have three fields_for inside a form_tag.

Two of them, correspond to the same model, :customer, (the two
objects, billing_customer and shipping_customer have been built in the
controller method). When I submit the form, the parameters only
include one of the two fields_for methods and it comes through as the
model name, not the object name:


I know there is a way to use two fields_for sections that correspond
to the same model... what am I doing wrong here?


Nik can you update mentioned URL with field names as well

try using following:
<% fields_for :shipping_customer do |sc| %>
  <%= sc.text_field%>
        <% end %>

        <% fields_for :billing do |bi| %>
  ...<%= b.text_field%>
        <% end %> <!-- end billing_fields -->

  <% fields_for :billing_customer do |bc| %>
  ....<%= bc.text_field%>
  <% end %>


I am using something like this and it is working for me.

let me know


Just what I needed. Many thanks, Ajit.