1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Do not pass :param_name option in paginate method

Do it in Tag class so we don't have to give it on the helper method.
This commit is contained in:
Yuki Nishijima 2013-12-02 06:43:15 +09:00
parent 8c0b9d5d1a
commit a4dc7a1ed4
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ module Kaminari
# * <tt>:remote</tt> - Ajax? (false by default)
# * <tt>:ANY_OTHER_VALUES</tt> - Any other hash key & values would be directly passed into each tag as :locals value.
def paginate(scope, options = {}, &block)
paginator = Kaminari::Helpers::Paginator.new self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :param_name => Kaminari.config.param_name, :remote => false)
paginator = Kaminari::Helpers::Paginator.new self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false)
paginator.to_s
end

View file

@ -15,7 +15,7 @@ module Kaminari
class Tag
def initialize(template, options = {}) #:nodoc:
@template, @options = template, options.dup
@param_name = @options.delete(:param_name)
@param_name = @options.delete(:param_name) || Kaminari.config.param_name
@theme = @options[:theme] ? "#{@options.delete(:theme)}/" : ''
@params = @options[:params] ? template.params.merge(@options.delete :params) : template.params
end