Class: Caboose::PostCustomFieldValuesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Caboose::PostCustomFieldValuesController
- Defined in:
- app/controllers/caboose/post_custom_field_values_controller.rb
Instance Method Summary collapse
-
#admin_update ⇒ Object
PUT /admin/post-custom-field-values/:id.
Methods inherited from ApplicationController
#add_ga_event, #admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_edit, #admin_index, #admin_json, #admin_json_single, #before_action, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #under_construction_or_forwarding_domain?, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in
Instance Method Details
#admin_update ⇒ Object
PUT /admin/post-custom-field-values/:id
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/caboose/post_custom_field_values_controller.rb', line 5 def admin_update return if !user_is_allowed('postcustomfieldvalues', 'edit') resp = Caboose::StdClass.new fv = PostCustomFieldValue.find(params[:id]) save = true params.each do |k, v| case k when 'value' then fv.value = v end end resp.success = save && fv.save render :json => resp end |