Put pagination info in a Link header, not the response body.
This is a fork of davidcelis/api-pagination that supports Grape rather than Rails.
class API < Grape::API
get :status_feed
@statuses = Status.page(params[:page])
paginate(:statuses)
@statuses
end
end
For more details on usage, see the original. It's basically the same but Grape has no filtering (before_filter
, after_filter
, etc.) functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request