From f625b2b244458fc4efa2100095d11212f470d0c6 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 8 Apr 2022 12:53:23 +0100 Subject: [PATCH] Use pagy series --- app/views/pagy/_nav.html.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/pagy/_nav.html.erb b/app/views/pagy/_nav.html.erb index 1dda448d2..961d6fe5b 100644 --- a/app/views/pagy/_nav.html.erb +++ b/app/views/pagy/_nav.html.erb @@ -14,11 +14,13 @@ page - <% (1..pagy.pages).each do |idx| %> - <% if pagy.page == idx %> -
  • Page <%= idx %> (current page)
  • + <% pagy.series.each do |item| %> + <% if item == :gap %> +
  • ...
  • + <% elsif item.is_a?(String) %> +
  • Page <%= item %> (current page)
  • <% else %> -
  • >Page <%= idx %>
  • +
  • >Page <%= item %>
  • <% end %> <% end %>