Clear::SQL::Query::WithPagination
Constants
DEFAULT_LIMIT = 50
DEFAULT_PAGE = 1
Instance methods
first_page?
Sourcelast_page?
Sourceout_of_bounds?
Helper method that is true when someone tries to fetch a page with a larger number than the last page. Can be used in combination with flashes and redirecting.
paginate(page : Int32 = DEFAULT_PAGE, per_page : Int32 = DEFAULT_LIMIT)
Enter pagination mode.
This is helpful to manage paginated table.
Pagination will handle the page progression automatically and update
offset and limit parameters by his own.
page = query.paginate(2, 50)