Class: ForemanDlm::DlmlocksController
- Inherits:
-
ApplicationController
show all
- Includes:
- Foreman::Controller::AutoCompleteSearch
- Defined in:
- app/controllers/foreman_dlm/dlmlocks_controller.rb
Instance Method Summary
collapse
#controller_name, #controller_permission, #resource_class, #resource_name
Instance Method Details
#destroy ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 17
def destroy
if @dlmlock.destroy
process_success(
:success_msg => _('Successfully deleted lock.'),
:success_redirect => foreman_dlm_dlmlocks_path
)
else
process_error
end
end
|
#disable ⇒ Object
39
40
41
42
43
44
45
46
47
48
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 39
def disable
if @dlmlock.disable!
process_success(
:success_msg => _('Successfully disabled lock.'),
:success_redirect => foreman_dlm_dlmlocks_path
)
else
process_error
end
end
|
#enable ⇒ Object
50
51
52
53
54
55
56
57
58
59
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 50
def enable
if @dlmlock.enable!
process_success(
:success_msg => _('Successfully enabled lock.'),
:success_redirect => foreman_dlm_dlmlocks_path
)
else
process_error
end
end
|
#index ⇒ Object
10
11
12
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 10
def index
@dlmlocks = resource_base_search_and_page(:host)
end
|
#model_of_controller ⇒ Object
61
62
63
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 61
def model_of_controller
ForemanDlm::Dlmlock
end
|
#release ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 28
def release
if @dlmlock.update(host: nil)
process_success(
:success_msg => _('Successfully released lock.'),
:success_redirect => foreman_dlm_dlmlocks_path
)
else
process_error
end
end
|
#show ⇒ Object
14
15
|
# File 'app/controllers/foreman_dlm/dlmlocks_controller.rb', line 14
def show
end
|