title: Cocoon link_to_add_association : ArgumentError: wrong number of arguments (2 for 1)
body: <p>I am integrating Cocoon to add multiple attachment with my property object.</p>
  
  <p>But when I am <strong>creating new property</strong> record, I am getting <code>ArgumentError: wrong number of arguments (2 for 1)</code> error</p>
  
  <pre><code>= form_for @property, remote: true, authenticity_token: true, html: { class: "form-horizontal", multipart: true } do |f|
   .links
     = link_to_add_association 'Add', f, :attachments
   .modal-footer
     .actions
       %button.btn.btn-default{"data-dismiss" =&gt; "modal", :type =&gt; "button"} Close
       = f.submit 'Save',  class: 'btn btn-warning'
  </code></pre>
  
  <p>/gems/cocoon-1.2.9/lib/cocoon/view_helpers.rb i.e. before
   new_object = create_object(f, association, force_non_association_create)</p>
  
  <pre><code>[1] pry(#&lt;#&lt;Class:0x0000000b46f630&gt;&gt;)&gt; create_object(f, association, force_non_association_create)
  
  ActionView::Template::Error (wrong number of arguments (2 for 1)):
     1: = form_for @property, remote: true, authenticity_token: true, html: { class: "form-horizontal", multipart: true } do |f|
     2:   .links
     3:     = link_to_add_association 'Add', f, :attachments
     4:   .modal-footer
     5:     .actions
     6:       %button.btn.btn-default{"data-dismiss" =&gt; "modal", :type =&gt; "button"} Close
   app/views/properties/_form.html.haml:3:in `block in _app_views_properties__form_html_haml___4571956341154479101_90407280' 
  
  from /home/dev05/.rvm/gems/ruby-2.2.2@me_backend/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/query.rb:35:in `attribute?'
  </code></pre>
  
  <p>I have models</p>
  
  <pre><code>class Property &lt; ActiveRecord::Base
   has_many :attachments, as: :attached_item, dependent: :destroy
   accepts_nested_attributes_for :attachments,allow_destroy: true
  end
  
  class Attachment &lt; ActiveRecord::Base
   belongs_to :attached_item, polymorphic: true
  end
  </code></pre>
  
  <p>Gem versions</p>
  
  <pre><code>rails version '4.2.5.1'
  ruby version '2.2.2'
  cocoon (1.2.9)
  </code></pre>
  
  <p>Gemfile.lock file snapshot</p>
  
  <pre><code>activerecord (4.2.5.1)
     activemodel (= 4.2.5.1)
     activesupport (= 4.2.5.1)
     arel (~&gt; 6.0)  rails (4.2.5.1)
     actionmailer (= 4.2.5.1)
     actionpack (= 4.2.5.1)
     actionview (= 4.2.5.1)
     activejob (= 4.2.5.1)
     activemodel (= 4.2.5.1)
     activerecord (= 4.2.5.1)
     activesupport (= 4.2.5.1)
     bundler (&gt;= 1.3.0, &lt; 2.0)
     railties (= 4.2.5.1)
     sprockets-rails
  </code></pre>
  
  <p>Can someone please help me to identify that what is causing issue to not creating the attachment.</p>