Class: Burp::GroupsController
Instance Method Summary
collapse
#init_body_classes, #menu
Instance Method Details
#create ⇒ Object
40
41
42
43
44
45
46
|
# File 'app/controllers/burp/groups_controller.rb', line 40
def create
= .find(params[:menu_id])
.children << Group.new(params[:group][:name])
.save
redirect_to ()
end
|
#destroy ⇒ Object
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/burp/groups_controller.rb', line 21
def destroy
= .find(params[:menu_id])
.update_id("")
@group_to_remove = .all_children().select {|child| child.id.to_s == params[:id].to_s}.first
@group = (.all_children+[]).select {|child| child.is_a?(Group) && child.children.include?(@group_to_remove)}.first
@group.children.delete(@group_to_remove)
.save
redirect_to ()
end
|
#edit ⇒ Object
5
6
7
8
9
|
# File 'app/controllers/burp/groups_controller.rb', line 5
def edit
= .find(params[:menu_id])
.update_id("")
@group = .all_children().select {|child| child.id.to_s == params[:id].to_s}.first
end
|
#new ⇒ Object
33
34
35
36
37
38
|
# File 'app/controllers/burp/groups_controller.rb', line 33
def new
= .find(params[:menu_id])
@group = nil
render :action => :edit
end
|
#update ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/burp/groups_controller.rb', line 11
def update
= .find(params[:menu_id])
.update_id("")
@group = .all_children().select {|child| child.id.to_s == params[:id].to_s}.first
@group.name = params[:group][:name]
.save
redirect_to ()
end
|