Class: Integral::BootstrapPaginationButtonRenderer

Inherits:
WillPaginate::ActionView::LinkRenderer
  • Object
show all
Defined in:
lib/integral/bootstrap_pagination_button_renderer.rb

Instance Method Summary collapse

Instance Method Details

#container_attributesObject

Container attributes



13
14
15
# File 'lib/integral/bootstrap_pagination_button_renderer.rb', line 13

def container_attributes
  super.except(:link_options)
end

Link item



18
19
20
21
# File 'lib/integral/bootstrap_pagination_button_renderer.rb', line 18

def link(text, target, attributes = {})
  attributes['data-page'] = target if target.is_a?(Integer)
  tag(:button, text, attributes)
end

#to_htmlObject

Pagination container



4
5
6
7
8
9
10
# File 'lib/integral/bootstrap_pagination_button_renderer.rb', line 4

def to_html
  list_items = pagination.map do |item|
    item.is_a?(Integer) ? page_number(item) : send(item)
  end.join(@options[:link_separator])

  tag(:ul, list_items, class: "pagination #{@options[:class]}")
end