Class: Backend::Forms::FieldsController
Instance Method Summary
collapse
#page_number, #paginate, #per_page
#update_position
#update_translation
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/backend/forms/fields_controller.rb', line 16
def create
@field = @form.fields.new(allowed_params)
if @field.save
redirect_to edit_translation_backend_form_field_path(@form, @field, locale),
notice: translate_notice(:added, :form_field)
else
render :new
end
end
|
#destroy ⇒ Object
36
37
38
39
40
|
# File 'app/controllers/backend/forms/fields_controller.rb', line 36
def destroy
@field.destroy
redirect_to backend_form_fields_path(@form),
notice: translate_notice(:deleted, :form_field)
end
|
#new ⇒ Object
12
13
14
|
# File 'app/controllers/backend/forms/fields_controller.rb', line 12
def new
@field = @form.fields.new
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'app/controllers/backend/forms/fields_controller.rb', line 27
def update
if @field.update_attributes allowed_params
redirect_to backend_form_fields_path(@form),
notice: translate_notice(:edited, :form_field)
else
render :edit
end
end
|