I have two links ( could be buttons if needed ) that say accept and decline and I need to send true or false parameters to my controller action by clicking one of those links. I don't want my parameters to be visible in the url so I need to use put method. I have tried with the link_to with defined method:
<%= link_to 'accept', { action: 'accept_offer', accept: true }, method: :put %>
<%= link_to 'decline', { action: 'accept_offer', accept: false }, method: :put %>
but my params are still visible.
I've tried using button_to but then my parameters are not passed. What is the best way to determine which option has been chosen (accept or decline) without showing parameters in url?
my route has be defined like this:
put 'offers', to: 'offers#accept_offer'