Kaminari宝石的Ajax分页 [英] Ajax pagination with the Kaminari gem
问题描述
在最近的铁路广播之后,我正在使用网站中的https://github.com/amatsuda/kaminari"rel =" noreferrer> kaminari宝石而且我想做ajax分页
After a recent railscast I'm using the kaminari gem in my website and I want to do ajax pagination
kaminari文档说:the helper supports Rails 3 unobtrusive Ajax.
The kaminari docs say: the helper supports Rails 3 unobtrusive Ajax.
有人对如何执行此操作有任何提示或教程吗?我正在使用jquery,rails 3等.我想我的application.js文件中需要一些内容来监听分页导航中的按钮
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
推荐答案
感谢您使用Kaminari.
Thank you for using Kaminari.
我刚刚使用Kaminari和jQuery创建了一个简短的示例项目,因为我相信这是向您展示实际代码的最佳方法. git log告诉您的不仅仅是单词!
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!
那么,您可以看看"ajax"分支上的提交吗? https://github.com/amatsuda/kaminari_example/commits/ajax
So, could you take a look at the commits here on "ajax" branch? https://github.com/amatsuda/kaminari_example/commits/ajax
希望这会有所帮助!
这篇关于Kaminari宝石的Ajax分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!