Marten::DB::Query::Paginator(M)
Inherits Marten::Template::Object / Marten::Template::CanDefineTemplateAttributes / Reference / Object
A query set paginator.
Paginators can be used to paginate the records that are targeted by a specific query set:
query_set = Post.all
query_set.paginator.page(2)
Constructors
Instance methods
page(number : Int)
Returns a specific page.
This method returns the Marten::DB::Query::Page object corresponding to the passed number. If the page
number does not correspond to any existing page, the latest page is returned.
page!(number : Int)
Returns a specific page.
This method returns the Marten::DB::Query::Page object corresponding to the passed number. If the page
number does not correspond to any existing page, a Marten::DB::Query::Paginator::EmptyPageError exception is
raised.
page_size
Sourcequeryset
Source