Class: Admin::MenusController
- Inherits:
-
ForestController
- Object
- ForestController
- Admin::MenusController
- Defined in:
- app/controllers/admin/menus_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /menus.
-
#destroy ⇒ Object
DELETE /menus/1.
-
#edit ⇒ Object
GET /menus/1/edit.
-
#index ⇒ Object
GET /menus.
-
#new ⇒ Object
GET /menus/new.
-
#show ⇒ Object
GET /menus/1.
-
#update ⇒ Object
PATCH/PUT /menus/1.
Instance Method Details
#create ⇒ Object
POST /menus
27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/admin/menus_controller.rb', line 27 def create @menu = Menu.new() @menu if @menu.save redirect_to (@menu), notice: 'Menu was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /menus/1
49 50 51 52 53 |
# File 'app/controllers/admin/menus_controller.rb', line 49 def destroy @menu @menu.destroy redirect_to , notice: 'Menu was successfully destroyed.' end |
#edit ⇒ Object
GET /menus/1/edit
22 23 24 |
# File 'app/controllers/admin/menus_controller.rb', line 22 def edit @menu end |
#index ⇒ Object
GET /menus
6 7 8 9 |
# File 'app/controllers/admin/menus_controller.rb', line 6 def index @menus = apply_scopes(Menu.order(id: :asc)).page(params[:page]) @menus end |
#new ⇒ Object
GET /menus/new
16 17 18 19 |
# File 'app/controllers/admin/menus_controller.rb', line 16 def new @menu = Menu.new @menu end |
#show ⇒ Object
GET /menus/1
12 13 |
# File 'app/controllers/admin/menus_controller.rb', line 12 def show end |
#update ⇒ Object
PATCH/PUT /menus/1
39 40 41 42 43 44 45 46 |
# File 'app/controllers/admin/menus_controller.rb', line 39 def update @menu if @menu.update() redirect_to (@menu), notice: 'Menu was successfully updated.' else render :edit end end |