Module: RESTFramework::Mixins::CreateModelMixin

Included in:
ModelControllerMixin
Defined in:
lib/rest_framework/mixins/model_controller_mixin.rb

Overview

Mixin for creating records.

Instance Method Summary collapse

Instance Method Details

#createObject



785
786
787
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 785

def create
  render(api: self.create!, status: :created)
end

#create!Object

Perform the create! call and return the created record.



790
791
792
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 790

def create!
  self.create_from.create!(self.get_create_params)
end