title: How to change dom element in ajax way but not replace the dom content using javascript way
body: <p>By default the page will show  <code>up vote button</code></p>
  
  <p>After user click <code>up button</code>, the page will reload again then show <code>down vote button</code></p>
  
  <p>Now I want to do it in Ajax way without loading the page,</p>
  
  <p>But how could I change the button without reloading the page ?</p>
  
  <pre><code>  - if not comment.has_evaluation?(:votes, current_user)
      = link_to vote_comment_path(comment, type: "up"), method: :post do
        %button.btn.btn-xs.btn-success
          Like this
    - else
      = link_to vote_comment_path(comment, type: "down"), method: :post do
        %button.btn.btn-xs.btn-danger
          Unlike this
  </code></pre>