Class: Panda::CMS::Admin::MenusController
- Inherits:
-
BaseController
- Object
- Panda::Core::Admin::BaseController
- BaseController
- Panda::CMS::Admin::MenusController
show all
- Defined in:
- app/controllers/panda/cms/admin/menus_controller.rb
Instance Method Summary
collapse
#set_current_request_details
#active_link?, #block_link_to, #component, #level_indent, #menu_indent, #nav_class, #nav_highlight_colour_classes, #panda_cms_collection, #panda_cms_collection_items, #panda_cms_editor, #panda_cms_feature_enabled?, #panda_cms_form_with, #selected_nav_highlight_colour_classes, #table_indent, #title_tag
Instance Method Details
#create ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 26
def create
= Panda::CMS::.new()
if .save
redirect_to , notice: "Menu was successfully created."
else
render :new, locals: {menu: }, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
52
53
54
55
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 52
def destroy
.destroy
redirect_to , notice: "Menu was successfully deleted."
end
|
#edit ⇒ Object
37
38
39
40
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 37
def edit
add_breadcrumb .name, ()
render :edit
end
|
#index ⇒ Object
Lists all menus which can be managed by the administrator
13
14
15
16
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 13
def index
= Panda::CMS::.order(:name)
render :index, locals: {menus: }
end
|
#new ⇒ Object
19
20
21
22
23
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 19
def new
= Panda::CMS::.new
add_breadcrumb "New Menu",
render :new, locals: {menu: }
end
|
#update ⇒ Object
43
44
45
46
47
48
49
|
# File 'app/controllers/panda/cms/admin/menus_controller.rb', line 43
def update
if .update()
redirect_to , notice: "Menu was successfully updated."
else
render :edit, status: :unprocessable_entity
end
end
|