From 7597a58f533a0499cf0126e462c3321e4317e78b Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:55:42 +0100 Subject: [PATCH] Add overflow handling on pagination --- config/initializers/pagy.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 843c685be6..1635eb82a4 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -9,3 +9,7 @@ Pagy::VARS[:items] = 100 require 'pagy/extras/items' Pagy::VARS[:items_param] = :per_page Pagy::VARS[:max_items] = 100 + +# For handling requests for non-existant pages eg: page 35 when there are only 4 pages of results +require 'pagy/extras/overflow' +Pagy::VARS[:overflow] = :empty_page