Module: Locomotive::API::Helpers::PaginationHelper

Defined in:
app/api/locomotive/api/helpers/pagination_helper.rb

Instance Method Summary collapse

Instance Method Details

#add_pagination_header(collection) ⇒ Object


6
7
8
9
10
# File 'app/api/locomotive/api/helpers/pagination_helper.rb', line 6

def add_pagination_header(collection)
  header 'X-Total-Pages',   collection.total_pages.to_s
  header 'X-Per-Page',      collection.limit_value.to_s
  header 'X-Total-Entries', collection.total_count.to_s
end