From 904059309be5e598eb5395a7bd76e61fcd820b47 Mon Sep 17 00:00:00 2001 From: Domizio Demichelis Date: Mon, 28 May 2018 18:05:41 +0700 Subject: [PATCH] added doc about skipping single pages navs --- docs/how-to.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/how-to.md b/docs/how-to.md index 2a3f52910..68afcc5c5 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -223,6 +223,10 @@ end ``` That would produce links that look like e.g. `2`. Then you can attach a javascript "click" event on the page links. When triggered, the `href` content (i.e. the page number) should get copied to a hidden `"page"` input and the form should be posted. +## Skipping single page navs + +Unlike other gems, Pagy does not decide for you that the nav of a single page of results must not be rendered. You may want it rendered... or maybe you don't. If you don't... use the `pagy_nav*` only if `@pagy.pages > 1` is true. + ## Using Templates The `pagy_nav*` helpers are optimized for speed, and they are really fast. On the other hand editing a template might be easier when you have to customize the rendering, however every template system adds some inevitable overhead and it will be about 40-80% slower than using the related helper, so choose wisely.