Class: Spud::Admin::MenusController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Spud::Admin::MenusController
- Defined in:
- app/controllers/spud/admin/menus_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 19 def create "New", :new_spud_admin_menu_path @menu = SpudMenu.new(params[:spud_menu]) flash[:notice] = "New menu created" if @menu.save respond_with @menu,:location => (:menu_id => @menu.id) end |
#destroy ⇒ Object
38 39 40 41 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 38 def destroy flash[:notice] = "Menu removed!" if @menu.destroy respond_with @menu,:location => end |
#edit ⇒ Object
26 27 28 29 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 26 def edit "Edit #{@menu.name}", :edit_spud_admin_menu_path respond_with @menu end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 7 def index @menus = SpudMenu.order(:name).paginate :page => params[:page] respond_with @menus end |
#new ⇒ Object
13 14 15 16 17 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 13 def new "New", :new_spud_admin_menu_path @menu = SpudMenu.new respond_with @menu end |
#update ⇒ Object
31 32 33 34 35 36 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 31 def update "Edit #{@menu.name}", :edit_spud_admin_menu_path flash[:notice] = "Menu saved successfully" if @menu.update_attributes(params[:spud_menu]) respond_with @menu,:location => (:menu_id => @menu.id) end |