Skip to content

Commit bd0c337

Browse files
authored
pagy update (#473)
* pagy update * fix dead link * .
1 parent 83074e5 commit bd0c337

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

docs/4.0/avo-3-avo-4-upgrade.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,23 @@ class Avo::Resources::User < Avo::BaseResource
296296
end
297297
```
298298

299+
## Pagination
300+
301+
### Replace `size` with `slots`
302+
303+
If you configured any resource pagination using the `size` option, update your pagination option from `size` to `slots`.
304+
305+
```ruby
306+
self.pagination = -> do
307+
{
308+
size: ... # [!code --]
309+
slots: ... # [!code ++]
310+
}
311+
end
312+
```
313+
314+
Check the <a href="./resources.html#slots">slots documentation</a> for more details.
315+
299316
## Breadcrumbs
300317

301318
The Breadcrumbs API has been improved.

docs/4.0/avo-application-controller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ When you need to do that, you may feel the need to override it with your own ver
1010
# Copied from Avo to `app/controllers/avo/application_controller.rb`
1111
module Avo
1212
class ApplicationController < ::ActionController::Base
13-
include Pagy::Backend
13+
include Pagy::Method
1414
include Avo::ApplicationHelper
1515
include Avo::UrlHelpers
1616

docs/4.0/resources.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -975,14 +975,14 @@ This is especially beneficial for large datasets, where displaying the total num
975975
self.pagination = -> do
976976
{
977977
type: :default,
978-
size: [1, 2, 2, 1],
978+
slots: 9,
979979
}
980980
end
981981

982982
# Or as hash:
983983
self.pagination = {
984984
type: :default,
985-
size: [1, 2, 2, 1],
985+
slots: 9,
986986
}
987987
```
988988

@@ -998,17 +998,15 @@ The exposed pagination setting above have the default value for each key.
998998

999999
`:default`
10001000

1001-
### `size`<br><br>
1001+
### `slots`<br><br>
10021002

10031003
#### Possible values
10041004

1005-
[Pagy docs - Control the page links](https://ddnexus.github.io/pagy/docs/how-to/#control-the-page-links)
1005+
[Pagy docs - Control the page links](https://ddnexus.github.io/pagy/toolbox/helpers/series_nav/#options)
10061006

10071007
#### Default
10081008

1009-
`[1, 2, 2, 1]` - before <Version version="3.11.5" />
1010-
1011-
`9` - <VersionReq version="3.11.5" />
1009+
`9`
10121010

10131011
### Examples
10141012

@@ -1018,7 +1016,7 @@ The exposed pagination setting above have the default value for each key.
10181016
self.pagination = -> do
10191017
{
10201018
type: :default,
1021-
size: [1, 2, 2, 1],
1019+
slots: 9,
10221020
}
10231021
end
10241022
```
@@ -1045,7 +1043,7 @@ end
10451043
self.pagination = -> do
10461044
{
10471045
type: :countless,
1048-
size: []
1046+
slots: 0
10491047
}
10501048
end
10511049
```

0 commit comments

Comments
 (0)