Module: Kaminari

Defined in:
lib/kaminari/engine.rb,
lib/kaminari/core.rb,
lib/kaminari/config.rb,
lib/kaminari/railtie.rb,
lib/kaminari/exceptions.rb,
lib/kaminari/jets/engine.rb,
lib/kaminari/core/version.rb,
lib/kaminari/helpers/tags.rb,
lib/kaminari/jets/turbine.rb,
lib/kaminari/helpers/paginator.rb,
lib/kaminari/helpers/helper_methods.rb,
lib/kaminari/models/array_extension.rb,
lib/kaminari/models/page_scope_methods.rb,
lib/generators/kaminari/views_generator.rb,
lib/generators/kaminari/config_generator.rb,
lib/kaminari/models/configuration_methods.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ConfigurationMethods, Core, Generators, Helpers, PageScopeMethods Classes: Config, Engine, PaginatableArray, Railtie, Turbine, ZeroPerPageOperation

Class Method Summary collapse

Class Method Details

.configObject



13
14
15
# File 'lib/kaminari/config.rb', line 13

def config
  @_config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



9
10
11
# File 'lib/kaminari/config.rb', line 9

def configure
  yield config
end

.paginate_array(array, limit: nil, offset: nil, total_count: nil, padding: nil) ⇒ Object

Wrap an Array object to make it paginatable

Options

  • :limit - limit

  • :offset - offset

  • :total_count - total_count

  • :padding - padding



70
71
72
# File 'lib/kaminari/models/array_extension.rb', line 70

def self.paginate_array(array, limit: nil, offset: nil, total_count: nil, padding: nil)
  PaginatableArray.new array, limit: limit, offset: offset, total_count: total_count, padding: padding
end