mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 22:36:50 +00:00
22 lines
463 B
Ruby
22 lines
463 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
class Responder < ::ActionController::Responder #:nodoc:
|
|
|
|
protected
|
|
def display(resource, given_options = {})
|
|
if format != :json
|
|
super
|
|
else
|
|
json = Serializer.build_json(controller, resource, options)
|
|
|
|
if json
|
|
render given_options.merge(options).merge(:json => json)
|
|
else
|
|
super
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|