Skip to content

Commit

Permalink
added searchkick references in docs, README and inititalizer example (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Aug 5, 2018
1 parent b9acf0c commit 5227bd1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -115,6 +115,10 @@ On resize, the number of page links will adapt in real-time to the available win

![pagy-responsive](docs/assets/images/pagy-responsive-w.png)

### Searchkick Extra

Paginate `Searchkick::Results` objects efficiently avoiding expensive oject-wrapping and without overriding. _(see [more...](http://ddnexus.github.io/pagy/extras/searchkick))_

### Trim Extra

Remove the `page=1` param from the first page link _(see [more...](http://ddnexus.github.io/pagy/extras/trim))_
Expand Down
1 change: 1 addition & 0 deletions docs/_layouts/default.html
Expand Up @@ -42,6 +42,7 @@ <h1 id="site-title">{{ site.title | default: site.github.repository_name }} <a c
<a href="{{ site.baseurl }}/extras/out_of_range"><p class="indent1" {% if page.title == 'Out Of Range' %}id="active"{% endif %} >Out Of Range</p></a>
<a href="{{ site.baseurl }}/extras/materialize"><p class="indent1" {% if page.title == 'Materialize' %}id="active"{% endif %} >Materialize</p></a>
<a href="{{ site.baseurl }}/extras/responsive"><p class="indent1" {% if page.title == 'Responsive' %}id="active"{% endif %} >Responsive</p></a>
<a href="{{ site.baseurl }}/extras/searchkick"><p class="indent1" {% if page.title == 'Searchkick' %}id="active"{% endif %} >Searchkick</p></a>
<a href="{{ site.baseurl }}/extras/trim"><p class="indent1" {% if page.title == 'Trim' %}id="active"{% endif %} >Trim</p></a>
<a href="{{ site.baseurl }}/migration-tips"><p {% if page.title == 'Migration Tips' %}id="active"{% endif %} >Migration Tips</p></a>
<p id="gitter-support"><a href="https://gitter.im/ruby-pagy/Lobby" rel="nofollow" target="_blank">&gt; Chat Support on Gitter &lt;</a></p>
Expand Down
3 changes: 2 additions & 1 deletion docs/extras.md
Expand Up @@ -6,7 +6,7 @@ title: Extras
Pagy comes with a few optional extensions/extras:

| Extra | Description | Links |
|:---------------|:-------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|
| :------------- | :----------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
| `array` | Paginate arrays efficiently avoiding expensive array-wrapping and without overriding | [array.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/array.rb), [documentation](extras/array.md) |
| `bootstrap` | Nav helper and templates for Bootstrap pagination | [bootstrap.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/bootstrap.rb), [documentation](extras/bootstrap.md) |
| `bulma` | Nav helper and templates for [Bulma](https://bulma.io) pagination component | [bulma.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/bulma.rb), [documentation](extras/bulma.md) |
Expand All @@ -16,6 +16,7 @@ Pagy comes with a few optional extensions/extras:
| `materialize` | Nav helper for Materialize CSS [pagination component](https://materializecss.com/pagination.html) | [materialize.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/materialize.rb), [documentation](extras/materialize.md) |
| `out_of_range` | Allow for easy handling of out of range pages | [out_of_range.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/out_of_range.rb), [documentation](extras/out_of_range.md) |
| `responsive` | On resize, the number of page links will adapt in real-time to the available window or container width | [responsive.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/responsive.rb), [documentation](extras/responsive.md) |
| `searchkick` | Paginate arrays efficiently avoiding expensive array-wrapping and without overriding | [searchkick.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/searchkick.rb), [documentation](extras/searchkick.md) |
| `trim` | Remove the `page=1` param from links | [trim.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/trim.rb), [documentation](extras/trim.md) |

## Synopsys
Expand Down
2 changes: 1 addition & 1 deletion docs/extras/searchkick.md
Expand Up @@ -3,7 +3,7 @@ title: Searchkick
---
# Searchkick Extra

This extra adds a specialized pagination for `Searchkick::Results` objects without the need to override the `pagy_get_items` in your controller.
Paginate `Searchkick::Results` objects efficiently avoiding expensive oject-wrapping and without overriding.

The `Searchkick::Results` object has already done pagination calculations, we just need to tell Pagy how to read page and total values. It is expected that you let Searchkick handle the `page` and `per_page` variables instead of providing those values as options to Pagy.

Expand Down
4 changes: 4 additions & 0 deletions lib/pagy/extras/initializer_example.rb
Expand Up @@ -41,6 +41,10 @@
# See https://ddnexus.github.io/pagy/extras/responsive#breakpoints
# Pagy::VARS[:breakpoints] = { 0 => [1,2,2,1], 350 => [2,3,3,2], 550 => [3,4,4,3] } # example of width/size pairs

# Searchkick: Paginate `Searchkick::Results` objects efficiently avoiding expensive oject-wrapping and without overriding.
# See https://ddnexus.github.io/pagy/extras/searchkick
# require 'pagy/extras/searchkick'

# Trim: Remove the page=1 param from links
# See https://ddnexus.github.io/pagy/extras/trim
# require 'pagy/extras/trim'
Expand Down

0 comments on commit 5227bd1

Please sign in to comment.