diff --git a/app/controllers/yiff_rest/api_v2/images_controller.rb b/app/controllers/yiff_rest/api_v2/images_controller.rb index 427fb84..4ff7c28 100644 --- a/app/controllers/yiff_rest/api_v2/images_controller.rb +++ b/app/controllers/yiff_rest/api_v2/images_controller.rb @@ -71,7 +71,7 @@ module YiffRest @results = Iqdb.query_image(APIImage.find(@sp[:image_id]), @sc) end @results ||= [] - @pagy, @images = pagy_array(@results.pluck("image"), size: [1, 2, 2, 1]) + @pagy, @images = pagy_array(@results.pluck("image"), max_items: @results.length) render(:index) end diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 204d90e..06709b8 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -2,4 +2,7 @@ require "pagy/extras/bootstrap" require "pagy/extras/array" -Pagy::DEFAULT[:items] = 20 +require "pagy/extras/items" +Pagy::DEFAULT[:items] = 25 +Pagy::DEFAULT[:items_max] = 250 +Pagy::DEFAULT[:items_param] = :limit