Form_remote_tag will not execute: method =>: put

Can someone tell me why this executes the POST method instead of my PUT method, which I specify in the ajax request?

<% form_remote_tag(
    :url => contact_url(detail),
    :method => :put,
    :complete => "Element.toggle($('#{form_id}))",
    :success => visual_effect(:shake, "contact-#{detail.id}"),
    :update => "contact-#{detail.id}",
    :html => {:id => form_id, :style => "display:none"}) do %>

Generated Output:

<form action="/contacts/1" id="tag-form-for-1" method="post" onsubmit="new Ajax.Updater('contact-1', '/contacts/1', {asynchronous:true, evalScripts:true, method:'put', onComplete:function(request){Element.toggle($('tag-form-for-1))}, onSuccess:function(request){new Effect.Shake(&quot;contact-1&quot;,{});}, parameters:Form.serialize(this)}); return false;" style="display:none">


<div style="margin:0;padding:0;display:inline">
<input name="authenticity_token" type="hidden" value="7807qAkHN3c1yyZlLoy9Z5pUByviR5az9vtuHHBbVv4=" />
</div>

<input id="tag_list" name="tag_list" size="40" type="text" value="Home Pittsburgh Ginger" />
<input id="form_id" name="form_id" type="hidden" value="tag-form-for-1" />

</form>
+5
source share
2 answers

After much thought, I realized this. It seems I need to put a method call: method =>: put in a hash: html. I do not know why. If someone can answer it will be helpful.

+4
source

If "put", "delete" or another verb is used, a hidden input with the name _method is added to simulate the verb above the message.

+1
source