Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual data for page_entries_info and will_paginate view helpers #456

Open
ninjonxb opened this issue Nov 20, 2015 · 0 comments
Open

Manual data for page_entries_info and will_paginate view helpers #456

ninjonxb opened this issue Nov 20, 2015 · 0 comments

Comments

@ninjonxb
Copy link

I am working on implementing an API that is using pagination for pagination and than another service that uses pagination to display the view.
The issue I am running into is the view helpers.
In the API if I just run "as_json" on the paginated results, it will only have the results with no paginate data.
After searching I found someone suggesting I do:

    render :json => {
      :current_page => query_results.current_page,
      :per_page => query_results.per_page,
      :total_entries => query_results.total_entries,
      :total_pages => query_results.total_pages,
      :entries => query_results
    }

But same issue.
I am trying to figure out if there is a better way to be doing this (I want to do paginate api side due to the number of records).
I tried to figure out if there was a way I could send the options into page_entries_info as a hash but I could not find it documented anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant