Skip to content

Commit

Permalink
added doc about skipping single pages navs
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 30, 2018
1 parent 605169a commit 9040593
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ end
```
That would produce links that look like e.g. `<a href="2">2</a>`. 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.
Expand Down

0 comments on commit 9040593

Please sign in to comment.