app/controllers/v1/api_controller/pagination.rb
def select_page(collection)
        page = params['page'] || 1
        # The value of the param of the request or the configuration value
        limit = params['limit'] || Rails.application.secrets.return_configuration[:items_per_page]
        # The result por the page *page* with a limit of *limit*
        collection.page(page).per(limit)
      end
# Get the specific page collection with limit option.
#
# @param collection [ActiveRecord] the result of the query
# @return [ActiveRecord] the result of the specific page
Get the specific page collection with limit option.
Get the specific page collection with limit option .
def select_page(collection)
        page = params['page'] || 1
        limit = params['limit'] || Rails.application.secrets.return_configuration[:items_per_page]
        collection.page(page).per(limit)
      end
def select_page ( collection ) page = params [ 'page' ] || 1 limit = params [ 'limit' ] || Rails . application . secrets . return_configuration [ :items_per_page ] collection . page ( page ) . per ( limit ) end
Get the specific page collection with limit option.
Get the specific page collection with limit option .
# The value of the param of the request or the configuration value # The result por the page *page* with a limit of *limit*
the result of the specific page
the result of the specific page
ActiveRecord
collection
the result of the query
the result of the query