Class: Showbuilder::ShowPaginateRenderer

Inherits:
WillPaginate::ActionView::LinkRenderer
  • Object
show all
Defined in:
lib/showbuilder/show_paginate_renderer.rb

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/showbuilder/show_paginate_renderer.rb', line 6

def to_html
  links = @options[:page_links] ? windowed_links : []

  links.unshift(page_link_or_span(@collection.previous_page, 'prev', @options[:previous_label]))
  links.push(page_link_or_span(@collection.next_page, 'next', @options[:next_label]))

  html = links.join(@options[:link_separator])

  html_content = @template.(:div, :class => :pagination) do
    @template.(:ul, html.html_safe)
  end
  @options[:container] ? html_content : html
end