title: Rails link that updates integer in DB
body: <p>I have a column in my table that is an integer. I'm trying to make a link in my application that puts a specific integer in that column.</p>
  
  <p>i.e. :</p>
  
  <p>User clicks link labeled 0 => record in DB sets record to 0</p>
  
  <p>User clicks link labeled 1 => record in DB sets record to 1</p>
  
  <p>ETC. . . </p>
  
  <p>In the VIEW:</p>
  
  <pre><code>&lt;%= link_to "0", 
       {:controller =&gt; "application", 
        :action =&gt; 'rate_app'}, 
        :class =&gt; "rate_btn", 
        :method=&gt; :put 
  %&gt;
  </code></pre>
  
  <p>In the CONTROLLER:</p>
  
  <pre><code>def rate_app(current_user, rating)
    current_user.nps_rating = rating
    if current_user.save
      redirect_to mypage_path
    end
  end
  </code></pre>
  
  <p>Does anyone see a conflict/mess-up in the code? I get an error.</p>