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