Ruby On Rails:获取记录
我正在寻找可以引导我创建页面的教程或一段代码 我们每页只能找到 10 行数据并使用 Ajax 上一个/下一个箭头进行导航 还有页码(即:<1 2 3 ... 10>)。
非常感谢。
I'm looking for a tutorial or a piece of code that can leads me to create a page
where we can find only 10 data rows per page and navigating with Ajax previous/next arrows
and also page number (i.e.: < 1 2 3 ... 10 > ).
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个好的起点是 Mislav 的 will-paginate 插件。该链接的自述文件应该解释如何使用它。
已编辑:
还有RailsCasts 上有关 Ajax 分页的截屏。我还没看过,但他的作品通常质量很高,而且很容易理解。
A good place to start is Mislav's will-paginate plugin. The Readme at that link should explain how to use it.
Edited:
There's also a screencast on RailsCasts about Ajax pagination. I haven't watched it, but his stuff is usually really high-quality and easy to follow.
它不是ajax,但也许它对你有用......当你在rails中使用haml和haml_scaffolding时,它会使用这种sacffolding自动分页
it's not ajax but maybe it's useful for you... when you use haml and haml_scaffolding in rails it's authomatic the pagination using this kind of sacffolding