title: rails many-to-many relationship with nested form link_to_add does not work
body: <p>I am trying to build complex form for adding Agendas, and I would like to use <code>link_to_add helper</code> to dynamicaly add new users for given agenda in form. using <code>nested_form</code> gem and <code>accepts_nested_attributes_for</code> method. These are my models:</p>
  
  <pre><code>class Agenda &lt; ActiveRecord::Base
    has_many :roles
    has_many :users, through: :roles
    accepts_nested_attributes_for :roles
  
    belongs_to :owner, class_name: User
  
    attr_accessible :name,
                    :address,
                    :owner,
                    :roles_attributes
  
  end
  
  
  class Role &lt; ActiveRecord::Base
    belongs_to :agenda
    belongs_to :user
    accepts_nested_attributes_for :user
  
    attr_accessible :agenda,
                    :role,
                    :user
  
  end
  
  class User &lt; ActiveRecord::Base
    has_many :roles
    has_many :agendas, through: :roles
  end
  </code></pre>
  
  <p>and my controller:</p>
  
  <pre><code>class AgendasController &lt; ApplicationController
  
    ...
  
    def new
      @agenda = Agenda.new
      @role = @agenda.roles.build
      @user = @role.build_user
    end
  end
  </code></pre>
  
  <p>and my form:</p>
  
  <pre><code>&lt;%= nested_form_for @agenda do |f| %&gt;
    ....
    &lt;%= f.fields_for :roles do |role_f| %&gt;
      &lt;%= role_f.fields_for :user do |user_f| %&gt;
        &lt;div class="control-group"&gt;
          &lt;%= user_f.label :email, :class=&gt;"control-label" %&gt;
          &lt;div class="controls controls-row"&gt;
            &lt;%= user_f.text_field :email %&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;% end %&gt;
      &lt;div class="control-group"&gt;
        &lt;%= role_f.label :role, :class=&gt;"control-label" %&gt;
        &lt;div class="controls controls-row"&gt;
          &lt;%= role_f.text_field :role %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;%= role_f.link_to_remove "Remove user" %&gt;
    &lt;% end %&gt;
    &lt;%= f.link_to_add "Add new users", :roles %&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>And everything works fine, except for link_to_add, which does not append <code>fields_for :user</code> block. How to make link_to_add helper to render whole <code>fields_for :roles</code> block together with <code>fields_for :user</code> block?</p>