From 8bc04f8b45f3b3d07cd1abff044d8feb02617c0a Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Tue, 16 Jul 2013 14:29:51 +0200 Subject: [PATCH] fix #1371 pass params to pagination helper give pagination helper (pagination_links_full and per_page_links) params which thay can forward to the link generation. --- app/helpers/pagination_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb index 92ba6fbc4c..7b5fc39187 100644 --- a/app/helpers/pagination_helper.rb +++ b/app/helpers/pagination_helper.rb @@ -25,7 +25,7 @@ module PaginationHelper html << content_tag(:span, "(#{paginator.offset + 1} - #{paginator.offset + paginator.length}/#{paginator.total_entries})", :class => 'range') - if per_page_links && links = per_page_links(paginator.per_page) + if per_page_links && links = per_page_links(paginator.per_page, merged_options[:params] || params) html << links end end @@ -35,11 +35,11 @@ module PaginationHelper html end - def per_page_links(selected=nil) + def per_page_links(selected=nil, options = params) links = Setting.per_page_options_array.collect do |n| n == selected ? content_tag(:span, n, :class => 'current') : - link_to_content_update(n, params.merge(:page => 1, :per_page => n)) + link_to_content_update(n, options.merge(:page => 1, :per_page => n)) end content_tag :span, :class => 'per_page_options' do links.size > 1 ? l(:label_display_per_page, links.join(', ')).html_safe : nil