Form_tag and link_to

Hi

I have a search box put in a form that I want when I submit I get
redirected to an other page where I get results
the problem is I can’t get the right link in the target page and I am
unable to make pagination because params is not set

let’s say I have the home page with the form:

<%= form_tag(result_path(:q => :term)) do %>
<%text_field :term %>

<%= submit_tag 'Search' %>
<% end %>

and result page like this:

<%= form_tag(result_path(:q => :term)) do %>
<%text_field :term %>

<%= submit_tag 'Search' %>
<% end %>

<% @results.each do |results| %>

<% end %>

<%= will_paginate @results %>

when I click Search button, I get result page but not like expected,
I get:
http://localhost:3000/result
and what I expected

http://localhost:3000/result?q:term

How can I solve this problem: making the query in a page and getting the
results in others page
without losing the normal behaviour of pagination and target form

rgds,

Hi,

Change the form :method to :get

<%= form_tag(result_path(:q => :term), :method => :get) do %>
<%text_field :term %>

<%= submit_tag 'Search' %>
<% end %>

thx, I’ll try this
but how can I fill the target form with the same term too in result page
(I
am trying to reproduce the google search experience )

rgds,

Like this .

<%= form_tag(result_path(:q => params[:q]), :method => :get) do %>

<%text_field :term %>

<%= submit_tag 'Search' %>
<% end %>

It worked greatly, thx
Is it possible to do the same thing between two pages of search without
submitting?
means I have two pages of results, I do a search with the first staying
in
the same page but when I click the second page I get the search term and
I
perform a search automatically in the second page
(like google: after doing a web search you click image and a search for
image with the same term is done or is it simple the sma epage with
different tabs)

rgds,