Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax pagination with the Kaminari gem

After a recent railscast I'm using the kaminari gem in my website and I want to do ajax pagination

The kaminari docs say: the helper supports Rails 3 unobtrusive Ajax.

Does anyone have any hints or tutorials on how to do this? I'm using jquery, rails 3 etc. I guess I need something in my application.js file that listens to the buttons in the pagination nav

If anyone needs code I will post it

like image 997
stephenmurdoch Avatar asked Mar 01 '11 18:03

stephenmurdoch


People also ask

What is kaminari gem?

Kaminari is a Scope & Engine based, clean, powerful, agnostic, customizable and sophisticated paginator for Rails 3+


1 Answers

Thank you for using Kaminari.

I just created a brief sample project using Kaminari and jQuery, as I believe this is the best way to show you the actual code. git log tells you more than words!

So, could you take a look at the commits here on "ajax" branch? https://github.com/amatsuda/kaminari_example/commits/ajax

Hope this helps!

like image 89
Akira Matsuda Avatar answered Sep 26 '22 01:09

Akira Matsuda