-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to configure via_per_page on has_many #2661
Comments
I think this can be useful, thanks for submitting it @smathieu API suggestion: module Avo
module Resources
class CatalogCertification < Avo::BaseResource
self.pagination = -> do
{
via_per_page: 72
per_page: 24
}
end
def fields
# ...
end
end
end This way inside |
You can set the Otherwise, IDK is field :certifications, as: :has_many, per_page: 72 |
If the global configuration is enough for you, @smathieu, then it's ok to close this issue. |
The global configuration doesn't work very well for us, as we do have a use case where we need ~100 records rendering in a page, but that's way too much for other views. This isn't super urgent for us, but we'd definitely benefit from the option to configure it. All proposed API would work, but I think I prefer the per field proposed by @adrianthedev |
Got it! Yes, the field config should work better from the same reason that you want to configure the per_page only in some scenarios. I added the |
Please assign to me |
Thank you @G-Simpson! |
Feature
Currently, it seems only possible to set a global
via_per_page
.It would be useful to have the ability to override that value in the resource itself.
API could be something like:
or alternatively, we could default it per resource.
This is useful because in most case, we want a smaller pagination window, but we do have a few workflows where it's useful to see a large amount of items for triggering action on a batch of records.
Current workarounds
Not aware of any
Screenshots or screen recordings
Additional context
The text was updated successfully, but these errors were encountered: