title: Why does the Rails increment method doesn't save the changes?
body: <p>I have this code to implement a thumbs <code>up/down</code> functionality in my rails app</p>
  
  <pre><code>if params[:vote][:type] == "up"
      answer = Answer.find_by_id(params[:vote][:id])
      answer.increment(:ups)
      render text: answer.ups
  end
  if params[:vote][:type] == "down"
      answer = Answer.find_by_id(params[:vote][:id])
      answer.increment(:downs)
      render text: answer.downs
  end
  </code></pre>
  
  <p><br/></p>
  
  <p>It doesn't give any error but the incremented value is not updated in the DB.</p>
  
  <p>This code works properly in rails console.</p>
  
  <p>Please help, </p>
  
  <p>Thanks in advance</p>