From 46117a9f103e2d547be2a47724e872b3f57ce983 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 8 Aug 2009 22:38:48 +0200 Subject: lots of new code to manage menu items - harder than expected :/ --- app/controllers/admin_controller.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/controllers/admin_controller.rb') diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 517506f..b911727 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -27,4 +27,23 @@ class AdminController < ApplicationController end end + def menu_search + @results = Node.search params[:search_term] + + respond_to do |format| + format.html do + render :partial => 'admin/menu_search_results' + end + + + format.js do + render( :json => @results.map do |node| + {:node_id => node.id, :title => node.title, :unique_name => node.unique_name} + end + ) + + end + end + end + end -- cgit v1.3