Skip to content

Commit

Permalink
docs small fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 23, 2018
1 parent 69546b3 commit fac1f34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/how-to.md
Expand Up @@ -242,7 +242,7 @@ You may want to read also the [Pagy::Frontend API documentation](api/frontend.md

## Caching the collecion count

Every pagination gem needs the collection count in order to calculate all the other variables involvd in the pagination. If you use a storage system like any SQL DB, there is no way to paginate and provide a full nav system without executing an extra query to get the collection count. That is usually not a problem if your DB is well organized and maintained, but that may not be always the case.
Every pagination gem needs the collection count in order to calculate all the other variables involved in the pagination. If you use a storage system like any SQL DB, there is no way to paginate and provide a full nav system without executing an extra query to get the collection count. That is usually not a problem if your DB is well organized and maintained, but that may not be always the case.

Sometimes you may have to deal with some not very efficient legacy apps/DBs that you cannot totally control. In that case the extra count query may affect the performance of the app quite badly.

Expand Down
5 changes: 3 additions & 2 deletions docs/migration-tips.md
Expand Up @@ -26,6 +26,7 @@ __Notice:__ Don't worry about missing something in this phase: if anything wont
#### Preparation

- Create an empty Pagy initializer file: you will add to it during the process.
- Replace the legacy gem with `gem "pagy"` in the `Gemfile` and `bundle`, or install and require the gem if you don't use bundler.
- Add the `include Pagy::Backend` statement to the application controller.
- Add the `include Pagy::Frontend` statement to the application helper.
- Keep handy the legacy gem doc and the [Pagy API doc](api/pagy.md) in parallel.
Expand Down Expand Up @@ -119,12 +120,12 @@ Please take a look at the topics in the [how-to](how-to.md) documentation: that

#### CSSs

If you used bootstrap the same CSSs should work seamlessly with `pagy_nav_bootstrap` or with any of the bootstrap templates. If the app didn't use bootstrap, you may need to rename some rule in your CSSs.
If the app uses the bootstrap pagination, the same CSSs should work seamlessly with `pagy_nav_bootstrap` or with any of the bootstrap templates. If the app doesn't use bootstrap, you may need to rename some rule in your CSSs.

#### I18n

If the app uses `I18n` you should copy and paste the entries in the [pagy.yml dictionary file](https://github.com/ddnexus/pagy/blob/master/lib/locales/pagy.yml) to the dictionaries of your app, and translate them accordingly.

#### Gain some more speed

In case the app is a single language app (even not English) you can gain some extra performance if you explicitly exclude the use of the `I18n` gem. In that case you should set `Pagy::I18N[:gem] = false` in the initializer. See the Pagy::I18N [:gem doc](api/frontend.md#pagyi18ngem) for more details.
In case the app is a single language app (only en, or only fr, etc.) you can gain some extra performance if you explicitly exclude the use of the `I18n` gem. In that case you should set `Pagy::I18N[:gem] = false` in the initializer. See the Pagy::I18N [:gem doc](api/frontend.md#pagyi18ngem) for more details.

0 comments on commit fac1f34

Please sign in to comment.