zenw0lf
zenw0lf

Reputation: 1332

How can I change the method used in Formtastic?

I was wondering how can I specify the method to send the data from a Formtastic form. It usually uses POST, but I'd like it to use GET in some cases (i.e. for a search form).

Is it possible/easy?

Upvotes: 2

Views: 1111

Answers (1)

Janteh
Janteh

Reputation: 398

You can specify the :method in the semantic_form_for tag, for a normal form_for tag it would look something like this:

<% form_for :post, @post, :url => post_path(@post), :html => { :method => :get } do |f| %>

I'm pretty sure it works the same for Formtastic forms.

Upvotes: 4

Related Questions