Module: RESTFramework::CreateModelMixin

Included in:
ModelControllerMixin
Defined in:
lib/rest_framework/controller_mixins/models.rb

Instance Method Summary collapse

Instance Method Details

#createObject



167
168
169
170
171
172
173
# File 'lib/rest_framework/controller_mixins/models.rb', line 167

def create
  @record = self.get_model.create!(self.get_create_params)
  @serialized_record = self.get_serializer_class.new(
    object: @record, controller: self
  ).serialize
  return api_response(@serialized_record)
end