Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pass get parameters in a post/put simple_form with Rails 3?

With simple_form 2.0.4, I do:

= simple_form_for(@thing) do |f|

It generates:

<form accept-charset="UTF-8" action="/things/37" class="simple_form" id="edit_thing_37" method="post" novalidate="novalidate">

But I need:

<form accept-charset="UTF-8" action="/things/37?foo=bar" class="simple_form" id="edit_thing_37" method="post" novalidate="novalidate">

How to do this?

Thanks!

like image 415
Habax Avatar asked Nov 15 '12 16:11

Habax


1 Answers

You could write

= simple_form_for(@thing, :url => thing_path(@thing, :foo => 'bar')) do |f|
like image 126
declan Avatar answered Oct 15 '22 05:10

declan