title: Duplicate rendering ajax
body: <p>I have this simple create.js.erb file that submits the form through ajax:</p>
  
  <p>Create.js.erb:</p>
  
  <pre><code>$(".answers").append("&lt;%= j render(@answer) %&gt;");
  $(".val").val("");
  $(".count").text("Answers (&lt;%= Answer.count %&gt;)");
  </code></pre>
  
  <p>It works and all but it creates a temporarily duplicate as well (it goes away when I refresh the page).</p>
  
  <p>On my other form it worked as expected. same code but different class selectors. The only difference is that I have an extra div on this one.</p>
  
  <p>Show.html.haml (The file where the duplicate occurs)</p>
  
  <pre><code>    .row.down
          .col-md-9.counter_text
              - if @question.answers.count &lt; 1
                  %h4.text-muted No answers yet. Be the first to answer!
          .col-md-9.padDown.answers
              = render :partial =&gt; @question.answers
              .hr
  </code></pre>
  
  <p>Answer's partial:</p>
  
  <pre><code>= div_for(answer) do
      .media
          - if @question.user.avatar.blank?
              %a{:href =&gt; "#", :onclick =&gt; "return false;", :class=&gt;"pull-left"}
                  %img{:src =&gt; "/assets/user.png", :width =&gt; "40"}
          - else
              = link_to "/users/"+"#{@question.user.id}", :class =&gt; "pull-left" do
                  = image_tag answer.avatar, :width =&gt; "40"
          .clearfix.visible-sm
  
          .media-body
              .small
                  - if answer.answer_id == current_user.id 
                      %p.pull-right
                          = link_to 'delete', [@question, answer], :method =&gt; :delete, :remote =&gt; true, :class =&gt; "black"
                  %h5.media-heading
                      = answer.username
                  %small.text-muted.media-heading
                      = time_ago_in_words(answer.created_at)
              %p.hidden-xs.down.black
                  = h(answer.body)
              %p.black.down
                  = link_to h(answer.demo), "http://"+h(answer.demo)
              .hr
  </code></pre>
  
  <p>My other form (the one that works):</p>
  
  <pre><code>    .row.down
          .col-md-9.test
              = render :partial =&gt; @campaign.comments
              .hr
  </code></pre>
  
  <p>Any reason on why it's happening?</p>
  
  <p><strong>edit</strong></p>
  
  <p>Here's an image to exemplify what's happening more:</p>
  
  <p><a href="https://i.stack.imgur.com/GBcmK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GBcmK.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/HsxkI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HsxkI.png" alt="enter image description here"></a></p>