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

paginate view helper is failing with includes #1096

Open
maxrosecollins opened this issue Aug 11, 2022 · 3 comments
Open

paginate view helper is failing with includes #1096

maxrosecollins opened this issue Aug 11, 2022 · 3 comments

Comments

@maxrosecollins
Copy link

maxrosecollins commented Aug 11, 2022

The pagination works technically, but when I try to show the view helper, it doesn't return any code.

I can navigate via the url using ?page=2 but the pagination links aren't showing.

Controller:

@orders = Order.page(params[:page]).per(2).includes(:user).references(:user)

View:
<%= paginate @orders %>
@maxrosecollins maxrosecollins changed the title paginate helper is failing with includes paginate view helper is failing with includes Aug 11, 2022
@maxrosecollins
Copy link
Author

Or the issue could be I am connecting to a shard in my controller?

Does the gem make further sql statements that I need to wrap?

ActiveRecord::Base.connected_to(role: :reading, shard: :shard_name)

@drkelly58
Copy link

Any update, or additional info on this?
I'm having a similar issue I have an A/R relation that has 4000+ records, but page 1 only shows 29 records.
page_entries_info shows "Displaying all 29 ..."

Also like op I can navigate to additional pages with ?page=2.
The second page and on all show the page navigation.

@yuki24
Copy link
Member

yuki24 commented Feb 5, 2024

We need a reproducible code snippet in order for us to investigate further. Could you anyone provide a failing test that replicates the issue being discussed here?

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

No branches or pull requests

3 participants