Class: Spud::Admin::MenusController
- Inherits:
-
CmsController
- Object
- CmsController
- 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 25 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 19 def create "New", :new_spud_admin_menu_path = SpudMenu.new(params[:spud_menu]) .site_id = session[:admin_site] flash[:notice] = "New menu created" if .save respond_with ,:location => .id != nil ? (:menu_id => .id) : end |
#destroy ⇒ Object
39 40 41 42 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 39 def destroy flash[:notice] = "Menu removed!" if .destroy respond_with ,:location => end |
#edit ⇒ Object
27 28 29 30 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 27 def edit "Edit #{@menu.name}", :edit_spud_admin_menu_path respond_with end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 7 def index = SpudMenu.site(session[:admin_site]).order(:name).paginate :page => params[:page] respond_with 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 = SpudMenu.new respond_with end |
#update ⇒ Object
32 33 34 35 36 37 |
# File 'app/controllers/spud/admin/menus_controller.rb', line 32 def update "Edit #{@menu.name}", :edit_spud_admin_menu_path flash[:notice] = "Menu saved successfully" if .update_attributes(params[:spud_menu]) respond_with ,:location => (:menu_id => .id) end |