PagyCursor

Extra Pagy to work with cursor pagination

Installation

Add this line to your application's Gemfile:

gem 'pagy_cursor'

And then execute:

$ bundle

Usage

Include the backend in some controller:

require "pagy_cursor"

include Pagy::Backend

Default

pagy_cursor(Post.all)

Before and After

pagy_cursor(Post.all, after: 10)
pagy_cursor(Post.all, before: 10)

With UUID

pagy_uuid_cursor(Post.all, after: "ce5d2741-4e52-49b2-bb76-c41b67ab3aad")
pagy_uuid_cursor(Post.all, before: "ce5d2741-4e52-49b2-bb76-c41b67ab3aad")

License

The gem is available as open source under the terms of the MIT License.