Module: RESTFramework::CreateModelMixin

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

Overview

Mixin for creating records.

Instance Method Summary collapse

Instance Method Details

#createObject



700
701
702
# File 'lib/rest_framework/controller_mixins/models.rb', line 700

def create
  return api_response(self.create!, status: :created)
end

#create!Object

Perform the ‘create!` call and return the created record.



705
706
707
# File 'lib/rest_framework/controller_mixins/models.rb', line 705

def create!
  return self.get_create_from.create!(self.get_create_params)
end