Module: ActiveModelSerializers::Jsonapi::ControllerSupport

Defined in:
lib/active_model_serializers/register_jsonapi_renderer.rb

Instance Method Summary collapse

Instance Method Details

#serialize_jsonapi(json, options) ⇒ Object



65
66
67
68
69
70
71
# File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 65

def serialize_jsonapi(json, options)
  options[:adapter] = :json_api
  options.fetch(:serialization_context) do
    options[:serialization_context] = ActiveModelSerializers::SerializationContext.new(request)
  end
  get_serializer(json, options)
end