title: Display several nested attributes in Rails form
body: <p>I've been looking for a solution for a few days, in a Rails 4.1 app, so here is my question :</p>
  
  <p>In a Rails app, I have my model User and Adress. </p>
  
  <pre><code> class User &lt; ActiveRecord::Base 
         has_many :adresses
         accepts_nested_attributes_for :adresses
  
   class Adress &lt; ActiveRecord::Base
         belongs_to :user
         accepts_nested_attributes_for :user
  </code></pre>
  
  <p>In my form, I make a form_tag for User, no problem.</p>
  
  <p>But, how I can display to the final user, in a form, 2 adresses fields?</p>
  
  <p>I use <code>&lt;%= f.fields_for :adress %&gt;</code> to display one, it's ok. But if I display two forms (so the user can enter 2 adresses) they have both the same name and the request post only keep one.</p>
  
  <p>I read the doc at <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-fields_for" rel="nofollow">http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-fields_for</a></p>
  
  <p>but, still, I don't get it.</p>
  
  <p>Is there a proper way to do it?</p>
  
  <p>Thanks </p>