Module: JSONAPI::Rails::ActionController::ClassMethods

Defined in:
lib/jsonapi/rails/action_controller.rb

Overview

def render(options = {})

  reverse_mapping = request.env[REVERSE_MAPPING_KEY]
  super(options.merge(_reverse_mapping: reverse_mapping))
end

Instance Method Summary collapse

Instance Method Details

#_deserializable(key, options, fallback, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
36
# File 'lib/jsonapi/rails/action_controller.rb', line 32

def _deserializable(key, options, fallback, &block)
  options = options.dup
  klass = options.delete(:class) || Class.new(fallback, &block)
  use Deserialization, key, klass, options
end

#deserializable_relationship(key, options = {}, &block) ⇒ Object



26
27
28
29
# File 'lib/jsonapi/rails/action_controller.rb', line 26

def deserializable_relationship(key, options = {}, &block)
  _deserializable(key, options,
                  JSONAPI::Deserializable::Relationship, &block)
end

#deserializable_resource(key, options = {}, &block) ⇒ Object



21
22
23
24
# File 'lib/jsonapi/rails/action_controller.rb', line 21

def deserializable_resource(key, options = {}, &block)
  _deserializable(key, options,
                  JSONAPI::Deserializable::Resource, &block)
end