Sha256: bfc0cf4f0151fec76b20294cabce0e7b6a59f84552e72e98ba27413f8cc5e694

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

module Kaminari
  module ActionViewExtension
    extend ActiveSupport::Concern
    module InstanceMethods
      # = Helpers
      #
      # A helper that renders the pagination links.
      #
      #   <%= paginate @articles %>
      #
      # ==== Options
      # * <tt>:window</tt> - The "inner window" size (2 by default).
      # * <tt>:outer_window</tt> - The "outer window" size (1 by default).
      # * <tt>:left</tt> - The "left outer window" size (1 by default).
      # * <tt>:right</tt> - The "right outer window" size (1 by default).
      # * <tt>:params</tt> - url_for parameters for the links (:controller, :action, etc.)
      # * <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)
        Kaminari::Helpers::PaginationRenderer.new self, options.reverse_merge(:current_page => scope.current_page, :num_pages => scope.num_pages, :per_page => scope.limit_value, :remote => false)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kaminari-0.10.1 lib/kaminari/helpers/action_view_extension.rb
kaminari-0.10.0 lib/kaminari/helpers/action_view_extension.rb