简体   繁体   English

阿贾克斯与Kaminari宝石的分页

[英]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 最近的一次railscast之后,我在我的网站上使用了kaminari gem ,我想做ajax分页

The kaminari docs say: the helper supports Rails 3 unobtrusive Ajax. kaminari文档说: 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 我正在使用jquery,rails 3等。我想我的application.js文件中需要一些内容来监听分页导航中的按钮

If anyone needs code I will post it 如果有人需要代码,我会发布它

Thank you for using Kaminari. 感谢您使用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. 我刚刚使用Kaminari和jQuery创建了一个简短的示例项目,因为我相信这是向您展示实际代码的最佳方式。 git log tells you more than words! git log告诉你的不仅仅是单词!

So, could you take a look at the commits here on "ajax" branch? 那么,你能看一下“ajax”分支上的提交吗? https://github.com/amatsuda/kaminari_example/commits/ajax https://github.com/amatsuda/kaminari_example/commits/ajax

Hope this helps! 希望这可以帮助!

I did it according to the following simple article and everything works pretty well 我根据以下简单的文章做了它,一切都很好

Ajax pagination with kaminari 阿贾克斯与kaminari的分页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM