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