Sha256: 03cb9130f45ab977d2dcfcfafd19d7ad0a8b5d200dce0fa097af4217ae3ddf58

Contents?: true

Size: 332 Bytes

Versions: 7

Compression:

Stored size: 332 Bytes

Contents

module Controller
  module PaginationConcern
    private

    def load_collection
      super.page(params[:page]).per(pagination_size)
    end

    def pagination_size
      return collection_scope.count if params[:per_page] == 'all'
      params[:per_page] || Itsf::Backend::Configuration.default_pagination_size
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.2.3 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.2.2 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.2.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.2.0 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.0.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-4.0.0 app/controllers/concerns/controller/pagination_concern.rb