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 => "« #{t('previous')}",
:next_label => "#{t('next')} »") %>
<% 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
精彩评论