Class: ForemanPuppet::EnvironmentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanPuppet::EnvironmentsController
show all
- Includes:
- Foreman::Controller::AutoCompleteSearch, EnvironmentsImport, Parameters::Environment
- Defined in:
- app/controllers/foreman_puppet/environments_controller.rb
Instance Method Summary
collapse
#environment_params
#import_environments, #obsolete_and_new
Instance Method Details
#create ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 19
def create
@environment = model_of_controller.new(environment_params)
if @environment.save
process_success
else
process_error
end
end
|
#destroy ⇒ Object
39
40
41
42
43
44
45
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 39
def destroy
if @environment.destroy
process_success
else
process_error
end
end
|
#edit ⇒ Object
28
29
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 28
def edit
end
|
#index ⇒ Object
9
10
11
12
13
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 9
def index
@environments = resource_base_search_and_page
@authorizer = Authorizer.new(User.current, collection: @environments)
end
|
#new ⇒ Object
15
16
17
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 15
def new
@environment = model_of_controller.new
end
|
#resource_class ⇒ Object
47
48
49
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 47
def resource_class
model_of_controller
end
|
#update ⇒ Object
31
32
33
34
35
36
37
|
# File 'app/controllers/foreman_puppet/environments_controller.rb', line 31
def update
if @environment.update(environment_params)
process_success
else
process_error
end
end
|