handing over a param from a rails form tag
I'm using a form tag to implement a search text_field.
<% form_tag catalogues_path(:select => params[:select]), :method => "get" do %>
The problem is the catalogues_path which should consist the select param. Unfortunately the select param doesn't get handed over in the upper example...
The result is the same as if I would just write:
<% form_tag catalogues_path, :method => "get" do %>
Any hint will be ap开发者_运维百科preciated!
Thanks Makrus
Hi If you want to sent something from your form as params[:select]
use hidden_field_tag :select, :value=>params[:select]
inside your form or do you want to have something like
http://localhost/catalogues?select=something
in your url ?
it work's for me .
why don't you write html directly then
<form method="get" action="/catalogues?select=<%= params[:select] %>">
</form>
精彩评论