Pagination

View the JSONAPI specification

View the YARD Documentation

View the Sample App: Server1Server2Client

View the JS Documentation

Pagination usually happens with no developer intervention, instead handled automatically by an Adapter. To customize:

paginate do |scope, current_page, per_page|
  scope.page(current_page).per(per_page)
end

A real-life example might be replacing the default Kaminari gem with will_paginate:

paginate do |scope, current_page, per_page|
  scope.paginate(page: current_page, per_page: per_page)
end