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 29, 2018
1 parent 064a2e5 commit fc1c4a8
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 fc1c4a8

Please sign in to comment.