kaminari paginator integration for grape API framework
kaminari paginator integration for grape API framework
kaminari paginator integration for grape API framework.
Add this line to your application's Gemfile:
gem 'grape-kaminari'And then execute:
$ bundleOr install it yourself as:
$ gem install grape-kaminari…Now you can make a HTTP request to your endpoint with the following parameters
page: your current page (default: 1)per_page: how many to record in a page (default: 10)offset: the offset to start from (default: 0)curl -v http://host.dev/api/posts?page=3&offset=10and the response will be paginated and also will include pagination headers
X-Total: 42
X-Total-Pages: 5
X-Page: 3
X-Per-Page: 10
X-Next-Page: 4
X-Prev-Page: 2
X-Offset: 10Bug reports and pull requests are welcome on GitHub at https://github.com/bsm/grape-kaminari.
No open issues yet, or sync has not completed.