Module: RESTFramework::UpdateModelMixin

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

Instance Method Summary collapse

Instance Method Details

#updateObject



176
177
178
179
180
181
182
183
184
185
# File 'lib/rest_framework/controllers/models.rb', line 176

def update
  @record = self.get_record
  if @record
    @record.attributes(self.get_update_params)
    @record.save!
    api_response(@record)
  else
    api_response({detail: "Record not found."}, status: 404)
  end
end