diff options
| author | hukl <contact@smyck.org> | 2009-08-08 22:38:48 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-08-08 22:38:48 +0200 |
| commit | 46117a9f103e2d547be2a47724e872b3f57ce983 (patch) | |
| tree | 3360a066676ecf776f62212912abcec4965bdf27 /app/controllers/admin_controller.rb | |
| parent | 4f249507da36f219b208f88e4dea5a5cd90ca254 (diff) | |
lots of new code to manage menu items - harder than expected :/
Diffstat (limited to 'app/controllers/admin_controller.rb')
| -rw-r--r-- | app/controllers/admin_controller.rb | 19 |
1 files changed, 19 insertions, 0 deletions
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 | |||
| 27 | end | 27 | end |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | def menu_search | ||
| 31 | @results = Node.search params[:search_term] | ||
| 32 | |||
| 33 | respond_to do |format| | ||
| 34 | format.html do | ||
| 35 | render :partial => 'admin/menu_search_results' | ||
| 36 | end | ||
| 37 | |||
| 38 | |||
| 39 | format.js do | ||
| 40 | render( :json => @results.map do |node| | ||
| 41 | {:node_id => node.id, :title => node.title, :unique_name => node.unique_name} | ||
| 42 | end | ||
| 43 | ) | ||
| 44 | |||
| 45 | end | ||
| 46 | end | ||
| 47 | end | ||
| 48 | |||
| 30 | end | 49 | end |
