Module: Irie::Extensions::Paging

Extended by:
ActiveSupport::Concern
Defined in:
lib/irie/extensions/paging.rb,
lib/irie/extensions/paging/autorender_page_count.rb

Overview

Allows paging of results.

Defined Under Namespace

Modules: AutorenderPageCount

Instance Method Summary collapse

Instance Method Details

#index(options = {}, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/irie/extensions/paging.rb', line 16

def index(options={}, &block)
  logger.debug("Irie::Extensions::Count.index") if ::Irie.debug?
  return super(options, &block) unless aliased_param_present?(:page_count)
  @page_count = (collection.count.to_f / self.number_of_records_in_a_page.to_f).ceil
  return respond_to?(:autorender_page_count, true) ? autorender_page_count(options, &block) : super(options, &block)
end