-1

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!

Extazystas
  • 488
  • 2
  • 11
  • I don't understand. You want to remove this option from pagination links? Why? – Marek Lipka Aug 08 '13 at 13:52
  • 1
    Once you have removed it, how do you know what page to show? – toro2k Aug 08 '13 at 13:55
  • I mean that option should be inside params, but not in the url path. It works with ajax, but I don't need ajax in this case. Just wanna to know if it possible – Extazystas Aug 08 '13 at 14:19
  • What have you tried? We expect to see some sample code showing you've given this some effort instead of just throwing it out there. – the Tin Man Aug 08 '13 at 15:02

1 Answers1

0

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.

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115