diff options
Diffstat (limited to 'app/controllers/admin/services_controller.rb')
-rw-r--r-- | app/controllers/admin/services_controller.rb | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index 46133588332..7c37f3155da 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -1,4 +1,6 @@ class Admin::ServicesController < Admin::ApplicationController + include ServiceParams + before_action :service, only: [:edit, :update] def index @@ -13,7 +15,7 @@ class Admin::ServicesController < Admin::ApplicationController end def update - if service.update_attributes(application_services_params[:service]) + if service.update_attributes(service_params[:service]) redirect_to admin_application_settings_services_path, notice: 'Application settings saved successfully' else @@ -37,15 +39,4 @@ class Admin::ServicesController < Admin::ApplicationController def service @service ||= Service.where(id: params[:id], template: true).first end - - def application_services_params - application_services_params = params.permit(:id, - service: Projects::ServicesController::ALLOWED_PARAMS) - if application_services_params[:service].is_a?(Hash) - Projects::ServicesController::FILTER_BLANK_PARAMS.each do |param| - application_services_params[:service].delete(param) if application_services_params[:service][param].blank? - end - end - application_services_params - end end |