mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Add pagination links automatically
Pagination links will be included in your response automatically as long as the resource is paginated using Kaminari or WillPaginate and if you are using a JSON-API adapter. The others adapters does not have this feature.
This commit is contained in:
@@ -164,7 +164,7 @@ module ActiveModel
|
||||
def add_links(options)
|
||||
links = @hash.fetch(:links) { {} }
|
||||
resources = serializer.instance_variable_get(:@resource)
|
||||
@hash[:links] = add_pagination_links(links, resources, options) if @options[:pagination]
|
||||
@hash[:links] = add_pagination_links(links, resources, options) if options[:pagination]
|
||||
end
|
||||
|
||||
def add_pagination_links(links, resources, options)
|
||||
|
||||
Reference in New Issue
Block a user