title: Rails 3 and fields_for with activemodel (tableless) object
body: <p>I have a tableless model that I'm trying to generate some form fields for.</p>
  
  <p>The form looks like so:</p>
  
  <pre><code>= form_for :users, url: users_path do |f|
    - books.each do |book|
      = f.fields_for :books, book do |bf|
        = bf.hidden_field :title, value: book.title
    = f.submit "Send"
  </code></pre>
  
  <p>What I'm expecting to be generated for each field is something like this:</p>
  
  <pre><code>&lt;input name="users[books][][title]" type="hidden" value="Some Book Title"&gt;
  &lt;input name="users[books][][title]" type="hidden" value="Some Book Title"&gt;
  &lt;input name="users[books][][title]" type="hidden" value="Some Book Title"&gt;
  </code></pre>
  
  <p>However, what I'm actually getting is</p>
  
  <pre><code>&lt;input name="users[books][title]" type="hidden" value="Some Book Title"&gt;
  &lt;input name="users[books][title]" type="hidden" value="Some Book Title"&gt;
  &lt;input name="users[books][title]" type="hidden" value="Some Book Title"&gt;
  </code></pre>
  
  <p>Which means when the form is submitted only the last input field is available as the previous two have been overwritten due to them referencing the same thing.</p>
  
  <p>This works ok when the model has an active record backend but not when it's tableless.</p>
  
  <p>Any suggestions?</p>