Update pagination in Api::StatesController

This commit is contained in:
Matt-Yorkley
2021-06-29 11:30:48 +01:00
parent eba60a6130
commit a146782bcd

View File

@@ -32,7 +32,7 @@ module Api
includes(:country).order('name ASC')
if pagination?
states = states.page(params[:page]).per(params[:per_page])
_pagy, states = pagy(states, items: params[:per_page])
end
states