Pagination + Search Parameters. How?

Hi!

I'm having trouble to pass filter parameters on my search form while using paginator, the issue is that when I click in the "Next Page" link, the current params are not passed along.

I'm using this in my view:

<%= text_field 'search', 'name' %>

and this for the links:

<%= pagination_links(@users_pages, :params => params[:search]) %>

This way the URL will have the parameters, but won't be under :search anymore and in the controller I expect something like this: params[:search][:name].

I've searched for older posts but still can't get it working. So, I wonder if someone can help me to figure out what's the best way to get this working.

Thanks!

Felipe,

   > I'm having trouble to pass filter parameters on my search form while    > using paginator, the issue is that when I click in the "Next Page"    > link, the current params are not passed along.

Should you decide to write the pagination links yourself, it's pretty easy to just change the page number in the url (and keep the other - search - parameters) :

in application_helper.rb: