Make limit parameter
This commit is contained in:
parent
624ac2f738
commit
771132f702
@ -71,7 +71,7 @@ module YiffRest
|
|||||||
@results = Iqdb.query_image(APIImage.find(@sp[:image_id]), @sc)
|
@results = Iqdb.query_image(APIImage.find(@sp[:image_id]), @sc)
|
||||||
end
|
end
|
||||||
@results ||= []
|
@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)
|
render(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,4 +2,7 @@
|
|||||||
|
|
||||||
require "pagy/extras/bootstrap"
|
require "pagy/extras/bootstrap"
|
||||||
require "pagy/extras/array"
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user