Skip to content

Commit

Permalink
updated support extra examples with pagy_countess
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Mar 17, 2019
1 parent 6fa1d03 commit f25b5f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/extras/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit f25b5f5

Please sign in to comment.