title: I get an undefined method `link_to_add_association' for #<#<Class:0x00007fb9a1cc4f68>:0x00007fb9a1fdf658> when using the gem "cocoon"
body: <p>I am trying to build a nested form with the gem cocoon and I am following this (<a href="https://www.driftingruby.com/episodes/nested-forms-with-cocoon" rel="nofollow noreferrer">https://www.driftingruby.com/episodes/nested-forms-with-cocoon</a>) tutorial as it's almost identical to what I intend to do. In short I want to create a form where a user can create a list and then add as many items as he/she wishes to that list. </p>
  
  <p>However, I get an undefined method `link_to_add_association' for #&lt;#:0x00007fb9a1fdf658>.<a href="https://i.stack.imgur.com/hqpYn.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p><strong>Models</strong></p>
  
  <pre><code>class User &lt; ApplicationRecord
  devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable, :validatable
  has_many :lists, dependent: :destroy
  end
  
  class List &lt; ApplicationRecord
  belongs_to :user
  has_many :items, dependent: :destroy
  accepts_nested_attributes_for :items, allow_destroy: true, reject_if: 
  proc { |att| att['description'].blank?}
  end
  
  class Item &lt; ApplicationRecord
  belongs_to :list, optional: true
  end
  </code></pre>
  
  <p><strong>Views</strong>
  <strong>_form.html.erb</strong></p>
  
  <pre><code>&lt;%= simple_form_for (@list) do |f|  %&gt;
   &lt;%= f.error_notification  %&gt;
   &lt;div class= "form-inputs"&gt; 
    &lt;%= f.input :name %&gt;
   &lt;/div&gt;
   &lt;h3&gt;Items&lt;/h3&gt;
   &lt;table class= "table"&gt; 
    &lt;thead&gt; 
     &lt;tr&gt; 
      &lt;th&gt;&lt;/th&gt;
      &lt;th&gt;Item Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
   &lt;/thead&gt;
   &lt;tbody class="items"&gt; 
    &lt;%= simple_fields_for :items do |builder| %&gt;
    &lt;%= render 'item_fields', f: builder %&gt;
    &lt;%end %&gt;
   &lt;/tbody&gt;
   &lt;/table&gt;
  
  &lt;div class= "form-actions"&gt; 
   &lt;%= f.button :submit %&gt;
   &lt;%= link_to_add_association 'Add Item', f, :items, class: 'btn btn- 
   primary', data: {association_insertion_node: '.items', 
   association_insertion_method: :append } %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><strong>_item_fields.html.erb</strong></p>
  
  <pre><code>&lt;tr class= "nested-fields"&gt; 
   &lt;td&gt; 
    &lt;%= link_to_remove_association "remove item", f, class: 'btn btn- 
    primary btn-xs' %&gt;
   &lt;/td&gt;
   &lt;td&gt; &lt;%= f.input :name, label: false %&gt;&lt;/td&gt;
   &lt;td&gt; &lt;%= f.input :description, label: false %&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>