Ajax pagination with the Kaminari gem

ぐ巨炮叔叔 提交于 2019-12-04 15:16:32

问题


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


回答1:


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!




回答2:


I did it according to the following simple article and everything works pretty well

Ajax pagination with kaminari



来源:https://stackoverflow.com/questions/5158532/ajax-pagination-with-the-kaminari-gem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!