Parent

Included Modules

Files

Kaminari::Helpers::Paginator

The main container tag

Public Instance Methods

each_page() click to toggle source
Alias for: each_relevant_page
each_relevant_page() click to toggle source

enumerate each page providing PageProxy object as the block parameter Because of performance reason, this doesn’t actually enumerate all pages but pages that are seemingly relevant to the paginator. “Relevant” pages are:

  • pages inside the left outer window plus one for showing the gap tag

  • pages inside the inner window plus one on the left plus one on the right for showing the gap tags

  • pages inside the right outer window plus one for showing the gap tag

# File lib/kaminari/helpers/paginator.rb, line 50
def each_relevant_page
  return to_enum(:each_relevant_page) unless block_given?

  relevant_pages(@window_options).each do |page|
    yield PageProxy.new(@window_options, page, @last)
  end
end
Also aliased as: each_page
page_tag(page) click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 68
def page_tag(page)
  @last = Page.new @template, @options.merge(:page => page)
end
render(&block) click to toggle source

render given block as a view template

# File lib/kaminari/helpers/paginator.rb, line 39
def render(&block)
  instance_eval(&block) if @options[:total_pages] > 1
  @output_buffer
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.