Class: Iron::FieldDefinitionsController
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/iron/field_definitions_controller.rb', line 16
def create
@field_definition = @schemable.field_definitions.build(field_definition_params)
if @field_definition.save
render :create, formats: :turbo_stream
else
render :new, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
34
35
36
37
|
# File 'app/controllers/iron/field_definitions_controller.rb', line 34
def destroy
@field_definition.destroy!
render :destroy, formats: :turbo_stream
end
|
#edit ⇒ Object
13
14
|
# File 'app/controllers/iron/field_definitions_controller.rb', line 13
def edit
end
|
#new ⇒ Object
9
10
11
|
# File 'app/controllers/iron/field_definitions_controller.rb', line 9
def new
@field_definition = @schemable.field_definitions.build(type: selected_field_definition_type)
end
|
#update ⇒ Object
26
27
28
29
30
31
32
|
# File 'app/controllers/iron/field_definitions_controller.rb', line 26
def update
if @field_definition.update(field_definition_params)
render :update, formats: :turbo_stream
else
render :edit, status: :unprocessable_entity
end
end
|