ruby on rails - Passing an extra param when submitting form generated with form_tag -


i have form:

<%= form_tag(example_path, method: :get) %> … <% end %> 

i like pass parameter along form params:

example: 1 

i've tried passing hash path helper, params ignored:

form_tag(example_path(example: 1), method: :get) 

how can add param without using hidden field.

in order want accomplish, need update route:

# config/routes.rb  "example/:your_param" => "your_controller#example", :as => :example 

and then, able in view:

<%= form_tag (example_path('value'), method: :get) %> .... 

i hope makes sense , you.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -