diff --git a/kaminari-core/lib/kaminari/helpers/helper_methods.rb b/kaminari-core/lib/kaminari/helpers/helper_methods.rb index 7600943..5d6a626 100644 --- a/kaminari-core/lib/kaminari/helpers/helper_methods.rb +++ b/kaminari-core/lib/kaminari/helpers/helper_methods.rb @@ -14,12 +14,13 @@ module Kaminari # * :param_name - parameter name for page number in the links (:page by default) # * :remote - Ajax? (false by default) # * :paginator_class - Specify a custom Paginator (Kaminari::Helpers::Paginator by default) + # * :template - Specify a custom template renderer for rendering the Paginator (receiver by default) # * :ANY_OTHER_VALUES - Any other hash key & values would be directly passed into each tag as :locals value. - def paginate(scope, paginator_class: Kaminari::Helpers::Paginator, **options) + def paginate(scope, paginator_class: Kaminari::Helpers::Paginator, template: nil, **options) options[:total_pages] ||= scope.total_pages options.reverse_merge! current_page: scope.current_page, per_page: scope.limit_value, remote: false - paginator = paginator_class.new self, options + paginator = paginator_class.new (template || self), options paginator.to_s end