I'm using Rails 4.2.3. In my coffee script, I’m manually editing the URL and action of a form to be like so …
# Alter the form submit behavior
$('#new_my_object').attr("action", "/my_objects/" + id)
$('#new_my_object').attr("method", "patch")
But I submit my form (by clicking on my submit button …)
<%= button_to "Save", { :action => "create" }, :method => :post, :class => 'button' %>
The request (on both Mac Chrome and Firefox) gets submitted with method = “GET” instead of what I changed it to. What do I need to do so that I can submit via a PATCH method? (I need to do this because this is what is required by my update action).