-
Notifications
You must be signed in to change notification settings - Fork 261
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
Replace kaminari with pagy #681
Changes from 2 commits
2fa1100
8b7bf2b
bf7126f
037b44a
d90e215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module PagyHelper | ||
include Pagy::Frontend | ||
end |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,20 +26,20 @@ | |||||
.col-sm-12.headroom | ||||||
%ul{:class => "restrooms-list", :id => "list"} | ||||||
= render @restrooms | ||||||
= paginate @restrooms | ||||||
!= pagy_nav @pagy | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a comparison here we could make to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! It can be rewritten in this way to maintain the
Suggested change
Originally, the |
||||||
/ .row | ||||||
/ .col-xs-12.headroom | ||||||
/ .restrooms-index-content | ||||||
/ = content_tag 'div', id: 'map-container', data: { latitude: params[:lat], longitude: params[:long] } do | ||||||
/ #map-content | ||||||
/ .restrooms-list | ||||||
/ = render @restrooms | ||||||
/ = paginate @restrooms | ||||||
/ != pagy_nav @pagy | ||||||
|
||||||
|
||||||
/ #results.headroom | ||||||
/ = content_tag 'div', id: 'mapContainer', data: { latitude: params[:lat], longitude: params[:long] } do | ||||||
/ #mapArea | ||||||
/ #list.restrooms-list | ||||||
/ = render @restrooms | ||||||
/ = paginate @restrooms | ||||||
/ != pagy_nav @pagy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed these lines are being reused in each desc, would it be possible to set this param for all of them outside of each example? Kinda like line 5 on the old file.
Something like
use :page, items_param :per_page, items: 10, max_items: 100
on line 5 ofthis file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have changed it so that those parameters are written as a class constant for the descs to reference instead and have committed that change. Grape Pagy does not appear to have anything equivalent to the old line 5, so this would be the best way to extract those parameters.