Alex Castillo

Joined

3,210 Experience
32 Lessons Completed
0 Questions Solved

Activity

There were some changes in pagy gem, that brake this code in newer versions:

Include pagy in your code (usually application_controller.rb)

include Pagy::Method

Offset-based pagination

@pagy, @records = pagy(:offset, Product.all)

Keyset-based pagination (fastest technique)

@pagy, @records = pagy(:keyset, Product.order(my_order).all)

Paginate your collection with one of several paginators

@pagy, @records = pagy(...)

  • Now it's used pagy::Method instead pagy::backend
  • there's no pagy:Frontend
  • in the view now we use <%== @pagy.series_nav %>