From f25b5f5c68bf6b57831092a55af4829868424f7b Mon Sep 17 00:00:00 2001 From: Domizio Demichelis Date: Sun, 17 Mar 2019 22:34:07 +0700 Subject: [PATCH] updated support extra examples with pagy_countess --- docs/extras/support.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/extras/support.md b/docs/extras/support.md index dd85846d7..9251cfe60 100644 --- a/docs/extras/support.md +++ b/docs/extras/support.md @@ -31,12 +31,12 @@ If you don't need the navbar you can just set the `:size` variable to an empty v You can also use the `pagy_prev_link` and `pagy_next_link` helpers provided by this extra, mostly useful if you also use the `countless` extra. -Here is an example: +Here is an example that use `pagy_countless` (saving one query per render): `incremental` action: ```ruby def incremental - @pagy, @records = pagy(Product.all, link_extra: 'data-remote="true"') + @pagy, @records = pagy_countless(Product.all, link_extra: 'data-remote="true"') end ``` @@ -113,7 +113,7 @@ For example, it is often used to show a few suggestions of "similar products" in For example: ```ruby -@pagy, @suggestions = pagy(Product.all, count: 25, items: 5, cycle: true) +@pagy, @suggestions = pagy_countless(Product.all, count: 25, items: 5, cycle: true) ``` Passing a forced `:count` of 25 will generate 5 pages of 5 items each that will always have a next page. Regardless the actual collection count, you will show the first 25 items of the collection, looping in stripes of 5 items each.