views:

87

answers:

1

Can someone tell me why this is executing the POST method instead of my PUT method that I specify on 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 %>

generate 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("contact-1",{});}, 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>

Thanks in advance

A: 

After much fooling around I figured this out. It appears I need to put the :method => :put call in the :html hash. Not sure why. If someone could answer that it would be helpful.

Adam T