Hi,

Change the form :method to :get

<%= form_tag(result_path(:q => :term), :method => :get) do %>
 <%text_field :term %>
 <div><%= submit_tag 'Search' %></div>
<% end %>




On Thu, Jan 15, 2015 at 3:00 PM, Melb01 <melaggo...@gmail.com> wrote:

> 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 %>
>  <div><%= submit_tag 'Search' %></div><% end %>
>
> and result page like this:
>
>
> <%= form_tag(result_path(:q => :term)) do %>
>  <%text_field :term %>
>  <div><%= submit_tag 'Search' %></div><% end %>
> <div>
>
> <% @results.each do |results| %>
>  <!-- do smth with results--><% end %>
> <%= will_paginate @results %>
> </div>
>
> 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,
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/b638fea7-3de4-4dab-846a-edcd3623c40a%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/b638fea7-3de4-4dab-846a-edcd3623c40a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAFKVRj8mOPv70ywqWbr7949exaHYFqg6%3DwVCvnwDh9KiTLAL2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to