On Sep 4, 2011, at 8:16 PM, Jarin Udom wrote:

> I believe the :method => :put needs to go on semantic_form_for, not on 
> commit_button.
> 
> Jarin


You are correct!

In all other cases in my project Formtastic created something like this:

<form accept-charset="UTF-8" action="/admin/users/7" class="formtastic user" 
enctype="multipart/form-data" id="user_edit" method="post">
  ...
    <input name="_method" type="hidden" value="put" />  *
      ...
    <input class="update" id="user_submit" name="commit" type="submit" 
value="Submit" />  **

For some reason in this case Formtastic omits the line at * and put the method 
specification into the submit line

    <input class="primary create" id="result_submit" method="put" name="commit" 
type="submit" value="Create Result" />

Adding the method specification in like this:

  = semantic_form_for @results, :url => url, :html => {:method => :put} do |f|

adds the line at * back in.

There's a post at 
http://stackoverflow.com/questions/4608743/how-to-force-the-method-for-a-formtastic-form-to-be-put
 , which I should have found.

Thanks,

Scott

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to