Module: Grape::Pagy::Helpers

Extended by:
API::Helpers
Defined in:
lib/grape/pagy.rb

Instance Method Summary collapse

Instance Method Details

#pagy(collection, **opts) ⇒ Object

Parameters:

  • collection (Array|ActiveRecord::Relation)

    the collection or relation.



47
48
49
50
51
52
53
# File 'lib/grape/pagy.rb', line 47

def pagy(collection, **opts)
  defaults = route_setting(:pagy_options) || {}

  Wrapper.new(request, params).paginate(collection, **defaults, **opts) do |key, value|
    header key, value
  end
end