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
- #_deserializable(key, options, fallback, &block) ⇒ Object private
- #deserializable_relationship(key, options = {}, &block) ⇒ Object
- #deserializable_resource(key, options = {}, &block) ⇒ Object
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, , fallback, &block) = .dup klass = .delete(:class) || Class.new(fallback, &block) use Deserialization, key, klass, end |
#deserializable_relationship(key, options = {}, &block) ⇒ Object
26 27 28 29 |
# File 'lib/jsonapi/rails/action_controller.rb', line 26 def deserializable_relationship(key, = {}, &block) _deserializable(key, , 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, = {}, &block) _deserializable(key, , JSONAPI::Deserializable::Resource, &block) end |