Question

I'm using rails and will_paginate gem. Is it possible to remove 'page' option from URL to other place - e.g. params (without ajax) ?

For example instead www.site.com/products?page=2, always show www.site.com/products

Thanks!

Was it helpful?

Solution

No you can't, since you are doing a using an HTTP GET method, so you need to pass the parameters to allow the controller function to search the objects. The parameters hash goes on POST methods.

If you want an alternative solution, you can look at datatables for tables and pagination, which is done purely in javascript, but you need to fetch all the results first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top