Skip to content

Pagination #28

Closed
Closed
@beauby

Description

@beauby

Offer a controller-level interface for automatically adding pagination links.

Possible interface

An ActionController instance method jsonapi_pagination(resources) that gets automatically called at render time with the rendered collection. The method would return a Hash or nil.

Example

class UsersController < ...
  def jsonapi_pagination
    {
      first: ...,
      last: ...,
      ...
    }
  end

  def index
    # ...
    render jsonapi: users
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions