Class: MailyHerald::Webui::DispatchesController
Instance Method Summary
collapse
#create, #edit, #new, #show, #update
#expert_mode?, #work_mode
included
included
Instance Method Details
#archived ⇒ Object
9
10
11
12
13
14
15
|
# File 'app/controllers/maily_herald/webui/dispatches_controller.rb', line 9
def archived
self.class.superclass.instance_method(:index).bind(self).call do |scope|
scope.archived
end
render "index"
end
|
#destroy ⇒ Object
22
23
24
25
26
27
|
# File 'app/controllers/maily_herald/webui/dispatches_controller.rb', line 22
def destroy
@item.archive!
render_containers ["details", "entities"]
render_update
end
|
#index ⇒ Object
3
4
5
6
7
|
# File 'app/controllers/maily_herald/webui/dispatches_controller.rb', line 3
def index
super do |scope|
scope.not_archived
end
end
|
#toggle ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'app/controllers/maily_herald/webui/dispatches_controller.rb', line 29
def toggle
find_item
unless @item.enabled?
@item.enable!
else
@item.disable!
end
render_containers ["details", "entities"]
render_update
end
|
17
18
19
20
|
# File 'app/controllers/maily_herald/webui/dispatches_controller.rb', line 17
def update_form
new
@item.attributes = item_params
end
|