Skip to content

Include total as attribute or header #3

@aaronjoslyn

Description

@aaronjoslyn

It would be great to be able to get the total number for a given model when requesting a page from the index:

def index
query = resource.where(permitted_params).order(order_params).paginate(pagination_params)
yield query if block_given?
query = filters(query)
body = {resource_key.pluralize => query}
render_processed_entity(body)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions