Class: MenusController
Instance Method Summary
collapse
#check_route, #current_ability, #set_current_user
Instance Method Details
#create ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/menus_controller.rb', line 20
def create
= .new()
respond_to do |format|
if .save
format.html{ redirect_to }
else
format.html{ render :new }
end
end
end
|
#destroy ⇒ Object
44
45
46
47
48
49
50
|
# File 'app/controllers/menus_controller.rb', line 44
def destroy
respond_to do |format|
.where(parent_id: .id).destroy_all
.destroy
format.html{ redirect_to }
end
end
|
#edit ⇒ Object
31
32
|
# File 'app/controllers/menus_controller.rb', line 31
def edit
end
|
#index ⇒ Object
4
5
6
7
|
# File 'app/controllers/menus_controller.rb', line 4
def index
= .orderByParent
end
|
#new ⇒ Object
13
14
15
16
17
18
|
# File 'app/controllers/menus_controller.rb', line 13
def new
= .new
if params[:parent_id]
.parent_id = params[:parent_id]
end
end
|
#show ⇒ Object
9
10
11
|
# File 'app/controllers/menus_controller.rb', line 9
def show
= .where(parent_id: .id)
end
|
#update ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/menus_controller.rb', line 34
def update
respond_to do |format|
if .update()
format.html{ redirect_to }
else
format.html{ render :edit }
end
end
end
|