views:

45

answers:

2

Hi there,

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 appreciated!

Thanks Makrus

+1  A: 

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 ?

Bohdan Pohorilets
hidden_field_tag :select, params[:select] did it! the :value gets added to the select field. Thanks for your hint!
Markus
+1  A: 

it work's for me .

why don't you write html directly then

<form method="get" action="/catalogues?select=<%= params[:select] %>">

</form>
Salil
cause then the localisation param will not get added to the link like it should... But this could also be a solution!
Markus