class Paginator::Page
Page
object
Retrieves items for a page and provides metadata about the position of the page in the paginator
Attributes
Public Instance Methods
Source
# File lib/active_scaffold/paginator.rb, line 116 def first_item_number 1 + @offset end
The “item number” of the first item on this page
Source
# File lib/active_scaffold/paginator.rb, line 91 def items @items ||= @select.call end
Retrieve the items for this page
-
Caches
Source
# File lib/active_scaffold/paginator.rb, line 121 def last_item_number if next? @offset + @pager.per_page else @pager.count end end
The “item number” of the last item on this page
Source
# File lib/active_scaffold/paginator.rb, line 111 def next @pager.page(@number + 1) if next? end
Get next page (if possible)
Source
# File lib/active_scaffold/paginator.rb, line 106 def next? @number < @pager.number_of_pages end
Checks to see if there’s a page after this one
Source
# File lib/active_scaffold/paginator.rb, line 101 def prev @pager.page(@number - 1) if prev? end
Get previous page (if possible)
Source
# File lib/active_scaffold/paginator.rb, line 96 def prev? @number > 1 end
Checks to see if there’s a page before this one