-
Notifications
You must be signed in to change notification settings - Fork 864
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
Pagination links not showing on first page #460
Comments
I fınd another thing. When I remove order query from object pagination display on first page. But when I add order query it disappers. Edit: I remove order from controller and added default scope with order but problem still continue. PS: order that I add is update: There is two field in my schedules table one is starting_at(time), the other is occuring_on(date). When I order by occuring_on pagination displays. But when I order by starting_at pagination disappear on first page. interesting update: But for asc sort, problem still continue. |
For anyone running into this, I had a similar problem when sorting on an attribute translated by the Globalize Gem. The problem was for me that after applying the .order() clause, the active_record .limit() method was returning a wrong count because of .limit() using DISTINCT somewhere in the generated SQL. So a call to Item.with_translations.order('item_translations.sort_string ASC').limit(4).count would return 3 objects, because one of them had two translations where one was filtered out by the DISTINCT clause. This caused WillPaginate to think it had less items then the per_page limit allowed and than hide the pagination links The solution for my problem here was to join the specific translations only to guarantee a correct count for WillPaginate. Item.with_translations.joins(:translations).where('item_translations.locale = ?', I18n.locale).order('item_translations.sort_string ASC').limit(4).count == 4 |
@caccac Today I ran into the same problem. DESC sorting on a string column works fine but changing it to ASC let the pagination links disappear. Did you found a solution on this? |
Hi there,
I have a problem with pagination display.
I cant display pagination display on first page.
For example: http://www.etkinlikplus.com/static/home
on this link there isnt pagination links.
But on second page: http://www.etkinlikplus.com/static/home?page=2
on this link pagination links display.
I look all over internet but there is no solution even I dont have any error on heroku logs.
I want to add that I'm facing this problem only on remote(heroku). On local, pagination links are displaying correctly.
Problem still continue.
The text was updated successfully, but these errors were encountered: