I have the following button, which I overwrited to generate a GET request:
= button_to "Tutor", {:controller => "appointments", :action => "new",
:listing_id => @listing.id} , :method => :get
However, I still get a POST request with extra params :method:
Processing by AppointmentsController#new as HTML
Parameters: {"authenticity_token"=>"AWkL", "listing_id"=>"2", "method"=>"get"}
I my routes file, I have:
resources :appointments
What did I do wrong?
Thank you.
Buttons aren’t supposed to be sending
GETrequests.You should use a
link_toinstead. If you want it to look like a button, apply some CSS. Here’s a good article: http://coding.smashingmagazine.com/2009/11/18/designing-css-buttons-techniques-and-resources/