title: Rails: include index with fields_for form helper
body: <p>I'm trying to build two models from one form by using the fields_for method. My code looks like this:</p>
  
  <pre><code>&lt;% for scale in @event.scales %&gt;
    &lt;% f.fields_for "scale[]", scale do |scale_form| %&gt;
      &lt;p&gt;
        Scale&lt;br /&gt;
        &lt;%= scale_form.label :name %&gt;
        &lt;%= scale_form.text_field :name %&gt;
        &lt;%= scale_form.label :price %&gt;
        &lt;%= scale_form.text_field :price %&gt;
      &lt;/p&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>but unfortunately the output html is missing the IDs of the scales:</p>
  
  <pre><code>&lt;p&gt;
    Scale&lt;br /&gt;
    &lt;label for="event_scale__name"&gt;Name&lt;/label&gt;
    &lt;input id="event_scale__name" name="event[scale][][name]" size="30" type="text" /&gt;
    &lt;label for="event_scale__price"&gt;Price&lt;/label&gt;
    &lt;input id="event_scale__price" name="event[scale][][price]" size="30" type="text" /&gt;
  &lt;/p&gt;
  
  ...
  </code></pre>
  
  <p>Here's the corresponding controller and model:</p>
  
  <pre><code>class EventsController &lt; ApplicationController
    ...
  
    def new
      @event = Event.new
      @providers = Provider.find(:all, :order =&gt; :name)
      3.times { @event.scales.build }
      respond_to do |format|
        format.html
      end
    end
  
    ...
  end
  
  
  class Event &lt; ActiveRecord::Base
    has_many :scales
  
    ...
  end
  </code></pre>
  
  <p>what am I doing wrong?</p>