Class: Lipstick::Helpers::PaginationLinkRenderer
- Inherits:
-
Object
- Object
- Lipstick::Helpers::PaginationLinkRenderer
- Defined in:
- lib/lipstick/helpers/pagination_link_renderer.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 8 def items @items end |
Instance Method Details
#prepare(collection, _options, template) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 11 def prepare(collection, , template) @current = collection.current_page @total = collection.total_pages @items = [*prefix, *middle, *suffix] @template = template end |
#to_html ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 19 def to_html template.content_tag('nav', class: 'pagination-wrapper') do template.content_tag('ul', class: 'pagination') do items.each do |item| template.concat(render_item(item)) end end end end |