From 9c5108ffab6828562c5a976ddb92ac0ec459a9a3 Mon Sep 17 00:00:00 2001 From: hukl Date: Wed, 10 Jun 2009 23:21:39 +0200 Subject: added basic ajax search interface. lots of css / js improvements needed but it seems to work quite okay for now. more on that tomorrow --- app/controllers/admin_controller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/controllers/admin_controller.rb') diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 55c66cf..8d7d2ea 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -12,4 +12,19 @@ class AdminController < ApplicationController ) end + def search + @results = Node.search params[:search_term] + + respond_to do |format| + format.html + format.js do + render( :json => @results.map do |node| + {:id => node.id, :title => node.title} + end + ) + + end + end + end + end -- cgit v1.3