Class: Admin::MenuItemsController
- Inherits:
-
AdminController
- Object
- AdminController
- Admin::MenuItemsController
- Defined in:
- app/controllers/c/admin/menu_items_controller.rb
Instance Method Summary collapse
- #confirm_destroy ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #update ⇒ Object
- #update_order ⇒ Object
Instance Method Details
#confirm_destroy ⇒ Object
41 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 41 def confirm_destroy; end |
#create ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 12 def create if .save redirect_to , notice: 'Item Created' else render :new end end |
#destroy ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 33 def destroy .destroy respond_to do |format| format.js format.html { redirect_to [:menu_items] } end end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 8 def index = .hash_tree end |
#update ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 20 def update if .update() redirect_to , notice: 'Item Updated' else render :edit end end |
#update_order ⇒ Object
28 29 30 31 |
# File 'app/controllers/c/admin/menu_items_controller.rb', line 28 def update_order children = params.require(:order) MenuItem.update(children.keys, children.values) end |