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.
7 8 9 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 7 def items @items end |
Instance Method Details
#prepare(collection, _options, template) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 10 def prepare(collection, , template) @current = collection.current_page @total = collection.total_pages @items = [*prefix, *middle, *suffix] @template = template end |
#to_html ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/lipstick/helpers/pagination_link_renderer.rb', line 18 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 |