Class: Locomotive::CustomFields::SelectOptionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::CustomFields::SelectOptionsController
show all
- Defined in:
- app/controllers/locomotive/custom_fields/select_options_controller.rb
Instance Method Summary
collapse
#current_site_public_url, #public_page_url
Instance Method Details
#edit ⇒ Object
12
13
14
|
# File 'app/controllers/locomotive/custom_fields/select_options_controller.rb', line 12
def edit
respond_with @custom_field
end
|
#new_option ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'app/controllers/locomotive/custom_fields/select_options_controller.rb', line 21
def new_option
if params[:select_option].present?
option = @custom_field.select_options.build(name: option_name_param)
render partial: 'option', locals: { select_option: option }
else
head :unprocessable_entity
end
end
|
#update ⇒ Object
16
17
18
19
|
# File 'app/controllers/locomotive/custom_fields/select_options_controller.rb', line 16
def update
@options = service.update_select_options(options_params)
respond_with @custom_field, location: -> { last_saved_location!(default_back_location) }
end
|