-> per_page
Sets how many records the association table shows per page, for this field only. Use it when one association needs a different page size than the global via_per_page.
ruby
field :certifications, as: :has_many, per_page: 24The page size is picked in this order:
- A
per_pagevalue picked from the per-page dropdown (the?per_page=param) - The value saved in the session, when session persistence is on and its
paginationkey is not turned off - The field's
per_page config.via_per_page
The per-page dropdown on that table lists the field's per_page value, so users can always switch back to it.
INFO
With session persistence on, the saved page size is keyed by the parent resource and the associated resource, not by field. Two fields on the same parent that point at the same resource share it.
Default value
nil. The table uses config.via_per_page.
Possible values
Any positive integer.