开发者

Anyone know how to turn off will_paginate in Spree?

Deleting the lines of

<%  if pagina开发者_开发技巧ted_products.is_a?(WillPaginate::Collection) 
      params.delete(:search)
      params.delete(:taxon)

%><div class="clear"></div><%= will_paginate(paginated_products, 
                    :previous_label => "&#171; #{t('previous')}", 
                    :next_label => "#{t('next')} &#187;") %>
<%  end -%>

Only makes it so that the pagination nav disappears but not the pagination as a whole.


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.

ActiveRecord::Base.instance_eval do
  def per_page
    1000
  end
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜