class Kaminari::Helpers::Paginator

The main container tag

Public Instance Methods

each_page() { |page_proxy(merge, i, last)| ... } click to toggle source

enumerate each page providing PageProxy object as the block parameter

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

  1.upto(@options[:num_pages]) do |i|
    yield PageProxy.new(@window_options.merge(@options), i, @last)
  end
end
page_tag(page) click to toggle source
# File lib/kaminari/helpers/paginator.rb, line 42
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 28
def render(&block)
  instance_eval &block if @options[:num_pages] > 1
  @output_buffer
end