带标签云的 Rails 分页
我正在使用kaminari。它正在与一条链一起工作,我有 ActiveRecord::Relation 对象,但我不知道如何避免此错误。
代码在这里,使用 stackoverflow redactor 时遇到问题:/ http://pastie.org/1602799
问题是当我点击标签时,我收到错误
undefined method `current_page' for #<ActiveRecord::Relation:0x9ee7cb8>
我看到了一些解决方案,但是它们用于 will_paginate 并且似乎已弃用,我如何正确地为 tag_cloud 进行分页?没有分页,一切都可以完美运行。
我尝试了 kaminari 和 will_paginate,都给我错误:(
im using kaminari. It's working with a chain and i have ActiveRecord::Relation object, but i cant figure out, howto avoid this error.
Code here, have trouble with stackoverflow redactor :/
http://pastie.org/1602799
Problem is when i hit tag, i got error
undefined method `current_page' for #<ActiveRecord::Relation:0x9ee7cb8>
I seen some solution, but they for will_paginate and seems deprecated, how can i do pagination for tag_cloud properly? Without pagination everything work perfectly.
I try both kaminari and will_paginate, both give me errors :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这有效果吗?
Does this have any effect?
对于我们这些想要从馅饼中查看问题代码而无需来回切换的人来说。 (在小屏幕上很难看出解决方案是什么)
For those of us that want to see the questions code from the pastie without having to tab back and forth. (made it really hard to see what the solution was on a small screen)