1

I am using the kaminari gem to paginate my products list.

This search feature currently works with AJAX and has a top-bar filter style search:

enter image description here

This implies that a few parameters are passed from this search bar to the controller where they are processed to filter the results.

The kaminari paginate helper, however has its own links and it redirects to the controller action with only the :page parameter, and thus the rest of my search filters are ignored. So when I click on the page 2 or Next link, the products are no longer filtered and it shows page 2 of all products.

I need the search parameters to be sent every time a pagination link is clicked. How can I do that?

Marco Prins
  • 7,189
  • 11
  • 41
  • 76

1 Answers1

1

See this post please. It's answered by the maker of awesome Kaminari gem.

Ajax pagination with the Kaminari gem

I am not sure if you are using a gem for search functionality. If you are, this post might be helpful:

http://techbrownbags.wordpress.com/2014/01/17/rails-ajax-search-sort-paginate-with-ransack-kaminari/

Community
  • 1
  • 1
San
  • 1,954
  • 1
  • 14
  • 18