How to set the maximum number of items that can be downloaded.
I set:
require 'pagy/extras/items'
Pagy::VARS[:max_items] = 50
in config/initializers/pagy.rb.
Nevertheless, if I enter the address localhost:3000/cars?items=1000, I get 1000 results. And I expected 50.
How to limit the maximum number of elements that can be retrieved?
Pagy version 3.13 Rails version 6.1.3
Regards
If you set it in the
config/initializers/pagy.rb, it will not load instantly and so, it runs with old configs, I don't know why, I doubt the cache engine.So you can set it in the controller, example with mine app/controllers/pages_controller.rb
It will work fine, limit the max items to 50!