title: How to update 'status' value in table on each button click
body: <p>I want to update the <code>status</code> value in the <code>properties</code> table as (1 or 2 or 3 or 4) when I click on each button.</p>
  
  <p>These are my buttons in my view file:</p>
  
  <pre><code>&lt;td&gt;&lt;%= link_to("Waiting for Response", rms_property_approve_property_path(property, {:status =&gt; 'Waiting for Response'}), method: :patch, class: "btn btn-success", "data-no-turbolink" =&gt; true) %&gt;&lt;td&gt;
  &lt;td&gt;&lt;%= link_to("No Response", rms_property_approve_property_path(property, {:status =&gt; 'No Response'}), method: :patch, class: "btn btn-danger", "data-no-turbolink" =&gt; true) %&gt;&lt;td&gt;
  &lt;td&gt;&lt;%= link_to("Registered", rms_property_approve_property_path(property, {:status =&gt; 'Registered'}), method: :patch, class: "btn btn-success", "data-no-turbolink" =&gt; true) %&gt;&lt;td&gt;
  &lt;td&gt;&lt;%= link_to("Not Interested", rms_property_approve_property_path(property, {:status =&gt; 'Not Interested'}), method: :patch, class: "btn btn-danger", "data-no-turbolink" =&gt; true) %&gt;&lt;td&gt;
  </code></pre>
  
  <p>My <code>properties_controller.rb</code>:</p>
  
  <pre><code>  def approve
      @property = Property.find(params[:property_id])
      if params[:status]== 'Registered'
         @property.update_attributes(:status =&gt; 1)
         redirect_to :back, flash: {notice: "Property has been Registered."}
      elsif params[:status]== 'Not Interested'
         @property.update_attributes(:status =&gt; 2)
         redirect_to :back, flash: {notice: "Not Interested."}
      elsif params[:status]== 'Waiting for Response'
         @property.update_attributes(:status =&gt; 3)
         redirect_to :back, flash: {notice: "Waiting for Response"}
      elsif params[:status]== 'No Response'
         @property.update_attributes(:status =&gt; 4)
         redirect_to :back, flash: {notice: "No Response."}
      end
    end
  </code></pre>
  
  <p>My migration file for status column in <code>properties</code> table:</p>
  
  <pre><code>class AddColumnStatusInProperties &lt; ActiveRecord::Migration
    def change
       add_column :properties, :status, :string
    end
  end
  </code></pre>
  
  <p>When I click on the <code>No response</code> button, I get an ArgumentError:</p>
  
  <pre><code>'4' is not a valid status
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ptnps.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ptnps.png" alt="enter image description here"></a></p>