Class: Integral::BootstrapPaginationButtonRenderer
- Inherits:
-
WillPaginate::ActionView::LinkRenderer
- Object
- WillPaginate::ActionView::LinkRenderer
- Integral::BootstrapPaginationButtonRenderer
- Defined in:
- lib/integral/bootstrap_pagination_button_renderer.rb
Instance Method Summary collapse
-
#container_attributes ⇒ Object
Container attributes.
-
#link(text, target, attributes = {}) ⇒ Object
Link item.
-
#to_html ⇒ Object
Pagination container.
Instance Method Details
#container_attributes ⇒ Object
Container attributes
13 14 15 |
# File 'lib/integral/bootstrap_pagination_button_renderer.rb', line 13 def container_attributes super.except(:link_options) end |
#link(text, target, attributes = {}) ⇒ Object
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_html ⇒ Object
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 |