Class: Leaf::ViewHelpers::LinkRendererBase
- Inherits:
-
Object
- Object
- Leaf::ViewHelpers::LinkRendererBase
- Defined in:
- lib/leaf/view_helpers/link_renderer_base.rb
Overview
This class does the heavy lifting of actually building the pagination links. It is used by leaf
helper internally.
Direct Known Subclasses
Instance Method Summary collapse
- #pagination ⇒ Object
-
#prepare(collection, options) ⇒ Object
-
collection
is a Leaf::Collection instance or any other object that conforms to that API *options
are forwarded fromleaf
view helper.
-
Instance Method Details
#pagination ⇒ Object
20 21 22 23 24 |
# File 'lib/leaf/view_helpers/link_renderer_base.rb', line 20 def pagination items = [:page_links] ? windowed_page_numbers : [] items.unshift :previous_page items.push :next_page end |
#prepare(collection, options) ⇒ Object
-
collection
is a Leaf::Collection instance or any other object that conforms to that API -
options
are forwarded fromleaf
view helper
12 13 14 15 16 17 18 |
# File 'lib/leaf/view_helpers/link_renderer_base.rb', line 12 def prepare(collection, ) @collection = collection = # reset values in case we're re-using this instance @total_pages = @param_name = nil end |