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

#container_attributesObject


21
22
23
# File 'lib/bootstrap_pagination/bootstrap_renderer.rb', line 21

def container_attributes
  super.except(*[:link_options])
end

#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 Integer
        page_number(item)
      else
        send(item)
    end
  end.join(@options[:link_separator])

  tag("ul", list_items, class: ul_class)
end