Class: Admin::ServicesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/services_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject


8
9
10
11
12
13
# File 'app/controllers/admin/services_controller.rb', line 8

def edit
  unless service.present?
    redirect_to admin_application_settings_services_path,
      alert: "Service is unknown or it doesn't exist"
  end
end

#indexObject


4
5
6
# File 'app/controllers/admin/services_controller.rb', line 4

def index
  @services = services_templates
end

#updateObject


15
16
17
18
19
20
21
22
# File 'app/controllers/admin/services_controller.rb', line 15

def update
  if service.update_attributes(application_services_params[:service])
    redirect_to admin_application_settings_services_path,
      notice: 'Application settings saved successfully'
  else
    render :edit
  end
end