0

I have used kaminari for pagination. I have used ajax pagination

The pagination looses the page number and show all records from first page .

let say we have 5 pages and we moved to 3rd page and clicked one post and on back. Then how can we supposed to view that 3rd page directly instead of 1st page?

This code used for ajax pagination

<%= paginate @advertisements, remote: true %>

Any help is appreciated.

Thanks

Debadatt
  • 5,935
  • 4
  • 27
  • 40

1 Answers1

1

You need to add every visited page to the browser's history. Good news is that javascript object window has a property history which you can manipulate (e.g.: window.history.back(), window.history.forward(), window.history.pushState() etc.), bad news that it won't work in some older browsers. See https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history for more info.

Marek Takac
  • 3,002
  • 25
  • 30