title: nested_form displays a partial twice
body: <p>I'm using the gem nested_form in a Rails 3.1 application. The problem is that when I click on the link generated by "link_to_add", it displays the partial twice, whereas it should display it just once. There you go some code:</p>
  
  <p>Form:</p>
  
  <pre><code>&lt;%= nested_form_for @product, :html =&gt; {:multipart =&gt; true} do |f| %&gt;
  
    &lt;%= f.fields_for :safety_info_files %&gt;
    # adds a link for displaying the template
    &lt;%= f.link_to_add "Add file", :safety_info_files %&gt;
    &lt;div class="actions"&gt;
    &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Template:</p>
  
  <pre><code>&lt;div class="fields"&gt;
    &lt;%= f.link_to_remove "remove" %&gt;&lt;br /&gt;
    &lt;%= f.label :doc, "File" %&gt;
    &lt;%= f.file_field :doc %&gt;&lt;br /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Did anybody else have the same problem?</p>
  
  <p>EDIT:</p>
  
  <p>Silly mistake, silly me. Sorry if I made some of you wasting time, the problem was that I was loading "nested_form.js" twice, so it called the function that appended the partial the same number of times.</p>
  
  <p>Sorry again.</p>