title: Change params inside controller rails
body: <p>How can I change params inside controller? </p>
  
  <p>When I click the accept it will pass the status is approved but if <code>diff &lt;= 0</code> change status to rejected</p>
  
  <p>View </p>
  
  <pre><code>&lt;%= link_to 'Accept', friend_path(s, :request =&gt; {:status =&gt; 'Accepted'}), method: :put  %&gt;
  </code></pre>
  
  <p>into this</p>
  
  <pre><code>    if diff &lt;= 0
       req_params[:status] = "Rejected" 
       @request.update(req_params)
      end
  end 
  
  private 
   def req_params
      params.require(:request).permit(:status)
   end
  
  end
  </code></pre>