Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force the method for a formtastic form to be put?

I have something like

semantic_form_for @whatever, :url => whatever_url

which generates a from with

method="post"

I need it to be put, I've already tried:

semantic_form_for @whatever, :url => whatever_url, :html => {:method => "put"}

and

semantic_form_for @whatever, :url => whatever_url, :html => {:method => :put}

and

semantic_form_for @whatever, :url => whatever_url, :html_args => {:method => :put}

with no effect. Any ideas how it's done?

like image 845
pupeno Avatar asked Jan 05 '11 20:01

pupeno


1 Answers

See http://www.rubydoc.info/gems/formtastic/0.9.10/Formtastic/SemanticFormHelper and try:

  <% semantic_form_for :whatever, @whatever :url => posts_path, :html => {:method => :put} do |f| %>
    ...
  <% end %>
like image 77
BvuRVKyUVlViVIc7 Avatar answered Sep 21 '22 17:09

BvuRVKyUVlViVIc7