有人知道如何关闭 Spree 中的 will_paginate 吗?
删除 Only 行
<% if paginated_products.is_a?(WillPaginate::Collection)
params.delete(:search)
params.delete(:taxon)
%><div class="clear"></div><%= will_paginate(paginated_products,
:previous_label => "« #{t('previous')}",
:next_label => "#{t('next')} »") %>
<% end -%>
会使分页导航消失,但不会使整个分页消失。
Deleting the lines of
<% if paginated_products.is_a?(WillPaginate::Collection)
params.delete(:search)
params.delete(:taxon)
%><div class="clear"></div><%= will_paginate(paginated_products,
:previous_label => "« #{t('previous')}",
:next_label => "#{t('next')} »") %>
<% end -%>
Only makes it so that the pagination nav disappears but not the pagination as a whole.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有点 hackey,但您可以将
per_page
设置为 1,000 之类的值,这样就不必对结果进行分页。在 config/initializers/will_paginate.rb 中添加类似的内容应该可以。
It's a bit hackey but you could just set the
per_page
setting to something like 1,000 so it wouldn't ever have to paginate the results.Throwing something like this in
config/initializers/will_paginate.rb
should work.