title: Call method without opening show view - Rails
body: <p>I have a method which I would like to run from a controller, this should be done by clicking a button, the issue that I have is that when I click on the specific line or item I get redirect to that item's view.</p>
  
  <p>Here is the route that I have created:
  <code>patch '/withdraw/:id', to: 'payments#withdraw', as: :withdraw</code></p>
  
  <p>This is the link_to line:
  <code>&lt;%= link_to 'Withdraw', withdraw_path(pay), method: :post %&gt;</code></p>
  
  <p>And this is the method, which is actually updating existing attributes:</p>
  
  <pre><code>def withdraw
   @payment = Payment.find(params[:id])
   @payment.withdrawn = true
   @payment.amount_interest = @payment.amount * 1.1
   @payment.save
  end
  </code></pre>
  
  <p>What do I need to change in order to get the desired result? Any assistance will be greatly appreciated.</p>