will_paginate:如何构建“下一页”关联?
我知道这一定很简单,但环顾四周后我找不到答案。
我正在使用 will_paginate 插件,我喜欢有一个简单的“下一页”链接,而不是整个 will_paginate 链接集合。
我该怎么做?
谢谢!
I know this must be REALLY simple but after looking around I cannot find the answer.
I'm using the will_paginate plugin and I like to have a simple "next page" link instead of the whole will_paginate link collection.
How can I do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Rails v4 上使用 will_paginate v3:
Using will_paginate v3 on Rails v4:
这将为您提供一个简单的下一步按钮供您使用。
让我们知道您的进展如何。这是一个很棒的 博客文章 您也应该阅读。让我们知道您的进展如何。一切顺利。
This will give you just a simple next button to work with.
Let us know how you get on. Here is a great Blog Posts you should read as well. Let us know how you get on. All the best.
实际上,它比您想象的要复杂一些,有些人可能称之为“Rails Way”。 http://thewebfellas.com/blog /2008/8/3/roll-your-own-pagination-links-with-will_paginate
但是您也可以创建一个助手并使用方法
current_page
和total_pages
。所以像这样:It actually is a little more involved than you'd think to do it how some might call the "Rails Way". http://thewebfellas.com/blog/2008/8/3/roll-your-own-pagination-links-with-will_paginate
But you can also just make a helper and use the methods
current_page
andtotal_pages
. So something like: