Module: BootstrapPager

Defined in:
lib/bootstrap_pager/engine.rb,
lib/bootstrap_pager.rb,
lib/bootstrap_pager/hooks.rb,
lib/bootstrap_pager/config.rb,
lib/bootstrap_pager/railtie.rb,
lib/bootstrap_pager/version.rb,
lib/bootstrap_pager/helpers/tags.rb,
lib/bootstrap_pager/helpers/paginator.rb,
lib/bootstrap_pager/models/array_extension.rb,
lib/bootstrap_pager/models/mongoid_extension.rb,
lib/bootstrap_pager/models/page_scope_methods.rb,
lib/generators/bootstrap_pager/views_generator.rb,
lib/generators/bootstrap_pager/config_generator.rb,
lib/bootstrap_pager/models/configuration_methods.rb,
lib/bootstrap_pager/models/data_mapper_extension.rb,
lib/bootstrap_pager/helpers/action_view_extension.rb,
lib/bootstrap_pager/models/mongo_mapper_extension.rb,
lib/bootstrap_pager/models/active_record_extension.rb,
lib/bootstrap_pager/models/plucky_criteria_methods.rb,
lib/bootstrap_pager/models/mongoid_criteria_methods.rb,
lib/bootstrap_pager/models/active_record_model_extension.rb,
lib/bootstrap_pager/models/active_record_relation_methods.rb,
lib/bootstrap_pager/models/data_mapper_collection_methods.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ActionViewExtension, ActiveRecordExtension, ActiveRecordModelExtension, ActiveRecordRelationMethods, ConfigurationMethods, DataMapperCollectionMethods, DataMapperExtension, Generators, Helpers, MongoMapperExtension, MongoidCriteriaMethods, MongoidExtension, PageScopeMethods, PluckyCriteriaMethods Classes: Configuration, Engine, Hooks, PaginatableArray, Railtie

Constant Summary collapse

VERSION =
'0.11.0'

Class Method Summary collapse

Class Method Details

.configObject

Global settings for BootstrapPager


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

def self.config
  @config
end

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

Configures global settings for BootstrapPager

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

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

def self.configure(&block)
  yield @config ||= BootstrapPager::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


55
56
57
# File 'lib/bootstrap_pager/models/array_extension.rb', line 55

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