Will_paginate 页面链接在 Rails 2.3.8 中消失了
我正在使用 will_paginate 2.3.11 版本,多年来一直使用这个 gem。突然,页面链接消失了!也没有错误消息。
我已经卖掉了这颗宝石。我在供应商 gem 的“view_helpers.rb”文件中放置了一条调试语句,果然,它从视图中被正确调用。我还验证了我的集合对象是 WillPaginate::Collection 对象。
请注意,WillPaginate::Collection 对象使用total_entries 方法返回“3”,而数据库中实际上有565 个AR 对象。我正在对它进行空白查找。所以出了问题。
所以我猜想,因为total_entries只有3,所以页面链接没有显示,因为它认为只有一页。我只是想知道为什么它没有收到正确的号码。
I am using version 2.3.11 of will_paginate, been using this gem for years. Suddenly, the page links have disappeared! There is no error message either.
I have vendored this gem. I put a debug statement in the "view_helpers.rb" file in the vendored gem, and sure enough, it is getting called correctly from the view. I have also verified that my collection object is a WillPaginate::Collection object.
Please note that the WillPaginate::Collection object is returning "3" with the total_entries method, when there are in fact 565 of the AR object in the database. And I'm doing a blank find against it. So something is going wrong.
So I would guess that because the total_entries is only 3, the page links are not showing up because it thinks there is only one page. I just wonder why it doesn't pick up the right number.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个简单的 gem 升级到 2.3.16 就解决了这个问题。
A simple gem upgrade to 2.3.16 took care of this.