module Kaminari module ActionViewExtension extend ActiveSupport::Concern module InstanceMethods # = Helpers # # A helper that renders the pagination links. # # <%= paginate @articles %> # # ==== Options # * :window - The "inner window" size (4 by default). # * :outer_window - The "outer window" size (0 by default). # * :left - The "left outer window" size (0 by default). # * :right - The "right outer window" size (0 by default). # * :params - url_for parameters for the links (:controller, :action, etc.) # * :param_name - parameter name for page number in the links (:page by default) # * :remote - Ajax? (false by default) # * :ANY_OTHER_VALUES - 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, :num_pages => scope.num_pages, :per_page => scope.limit_value, :param_name => Kaminari.config.param_name, :remote => false) paginator.to_s end end end end