Module: BootstrapPagination::BootstrapRenderer

Included in:
Rails, Sinatra
Defined in:
lib/bootstrap_pagination/bootstrap_renderer.rb

Overview

Contains functionality shared by all renderer classes.

Constant Summary collapse

ELLIPSIS =
'…'

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bootstrap_pagination/bootstrap_renderer.rb', line 8

def to_html
  list_items = pagination.map do |item|
    case item
      when Fixnum
        page_number(item)
      else
        send(item)
    end
  end

  html_container(tag('ul', list_items.join(@options[:link_separator])))
end