Module: Kaminari

Defined in:
lib/kaminari/engine.rb,
lib/kaminari.rb,
lib/kaminari/hooks.rb,
lib/kaminari/config.rb,
lib/kaminari/version.rb,
lib/kaminari/railtie.rb,
lib/kaminari/exceptions.rb,
lib/kaminari/helpers/tags.rb,
lib/kaminari/helpers/paginator.rb,
lib/kaminari/models/array_extension.rb,
lib/kaminari/models/mongoid_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,
lib/kaminari/helpers/action_view_extension.rb,
lib/kaminari/models/active_record_extension.rb,
lib/kaminari/models/mongoid_criteria_methods.rb,
lib/kaminari/models/active_record_model_extension.rb,
lib/kaminari/models/active_record_relation_methods.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ActionViewExtension, ActiveRecordExtension, ActiveRecordModelExtension, ActiveRecordRelationMethods, ConfigurationMethods, Generators, Helpers, MongoidCriteriaMethods, MongoidExtension, PageScopeMethods Classes: Configuration, Engine, Hooks, PaginatableArray, Railtie, ZeroPerPageOperation

Constant Summary collapse

VERSION =
'1.0.0.alpha'

Class Method Summary collapse

Class Method Details

.configObject

Global settings for Kaminari


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

def self.config
  @config
end

.configure {|@config ||= Kaminari::Configuration.new| ... } ⇒ Object

Configures global settings for Kaminari

Kaminari.configure do |config|
  config.default_per_page = 10
end

Yields:


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

def self.configure(&block)
  yield @config ||= Kaminari::Configuration.new
end

.paginate_array(array, options = {}) ⇒ Object

Wrap an Array object to make it paginatable

Options

  • :limit - limit

  • :offset - offset

  • :total_count - total_count


63
64
65
# File 'lib/kaminari/models/array_extension.rb', line 63

def self.paginate_array(array, options = {})
  PaginatableArray.new array, options
end