Class: Burp::MenusController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Burp::MenusController
- Defined in:
- app/controllers/burp/menus_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#edit ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/burp/menus_controller.rb', line 8 def edit = Menu.find(params[:id]) .update_id("") all_items = .all_children = Group.new("pages not in menu") PageModel.all_paths.each do |path| path2 = path == "/" ? path : path + "/" if(all_items.select{|item| item.is_a?(Link) && (item.url == path || item.url == path2)}.length == 0) page = PageModel.find(path) .children << Link.new(page.title => page.path) end end render :layout => false if params[:no_layout] end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/burp/menus_controller.rb', line 4 def index = Menu.all end |
#update ⇒ Object
27 28 29 30 31 32 |
# File 'app/controllers/burp/menus_controller.rb', line 27 def update = Group.from_hash(JSON.parse(params[:menu])). .save render :json => {:success => true} end |