Skip to content

Commit

Permalink
Add pagination config
Browse files Browse the repository at this point in the history
It defaults to:

- the suggested GOV.UK settings for next/prev[0]
- 10 items per page

[0] https://govuk-components.netlify.app/components/pagination/#when-there-are-lots-of-pages
  • Loading branch information
peteryates committed Feb 5, 2025
1 parent 48728f1 commit 0398188
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions config/initializers/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# frozen_string_literal: true

# Array extra: Paginate arrays efficiently, avoiding expensive array-wrapping and without overriding
# See https://ddnexus.github.io/pagy/docs/extras/array
require 'pagy/extras/array'

# Overflow extra: Allow for easy handling of overflowing pages
# See https://ddnexus.github.io/pagy/docs/extras/overflow
require 'pagy/extras/overflow'
Pagy::DEFAULT[:overflow] = :empty_page # default (other options: :last_page and :exception)
require 'pagy/extras/size'

Pagy::DEFAULT[:overflow] = :empty_page # default (other options: :last_page and :exception)
Pagy::DEFAULT[:size] = [1, 1, 1, 1].freeze
Pagy::DEFAULT[:limit] = 10
Pagy::DEFAULT.freeze

0 comments on commit 0398188

Please sign in to comment.