Class: Kms::Models::FieldsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/kms/models/fields_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/kms/models/fields_controller.rb', line 6

def update
  model = Model.find(params[:model_id])
  @field = model.fields.find(params[:id])
  if @field.update(field_params)
    head :no_content
  else
    render json: @field.to_json(methods: :errors), status: :unprocessable_entity
  end
end