Api Pagination Versions Save

:page_facing_up: Link header pagination for Rails and Grape APIs.

v4.5.1

7 years ago

Move the definition of ApiPagination::Hooks to fix booting in Rails 3 and 4 environments (#72)

v4.5.0

7 years ago

Add support for Rails 5.

NOTE: The Rails::Pagination module will no longer be mixed into ActionController::Base if ActionController::API is also defined. If for any reason your API controllers cannot easily changed be changed to inherit from ActionController::API instead, you can manually include Rails::Pagination in your API's ApplicationController.

v4.4.0

7 years ago

api-pagination now allows developers to manually set a total_page when paginating Arrays. This is useful when paginating results from external services such as ElasticSearch or other APIs, where you are dealing with Arrays of already-paginated results as opposed to an ActiveRecord collection:

total_count = $redis.llen "ratings"
page, per_page = params.fetch(:page, 1), params.fetch(:per_page, 25)
start = (page - 1) * per_page
results = $redis.lrange "ratings", start, start + per_page

paginate results, paginate_array_options: { total_count: total_count }

v4.1.1

9 years ago

Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator is called.

v3.2.1

9 years ago

Warnings about including both Kaminari and WillPaginate are now deferred until ApiPagination.config.paginator is called.

v4.1.0

9 years ago

Add ApiPagination::Configuration

Add a configuration object that handles names of Total and Per-Page headers, as well as allows for the manual setting of the paginator that ApiPagination will use. It's up to the user to make WillPaginate and Kaminari play nicely together if they include both.

v3.2.0

9 years ago

Add ApiPagination::Configuration

Add a configuration object that handles names of Total and Per-Page headers, as well as allows for the manual setting of the paginator that ApiPagination will use. It's up to the user to make WillPaginate and Kaminari play nicely together if they include both.

v4.0.0

9 years ago

This release includes compatibility for recent versions of Grape (0.10.0 and later). Unfortunately this is not backwards compatible with previous Grape versions. If using Grape 0.9.x or earlier, continue using api-pagination 3.1.x. This will continue to receive bug fixes.

v3.1.0

9 years ago
  • #15: Allow paginate to directly accept a collection and return the paginated collection itself instead of implicitly rendering (an implicit render will still happen if the call to paginate mimics a call to render)
  • #14: Avoid dividing by 0 (thanks to @macb)

v3.0.2

10 years ago
  • Fix an issue where paginate_with would raise an exception in Rails (#11)
  • Fix an issue where the per_page option could not be overridden in Grape (#12)