diff options
| author | hukl <contact@smyck.org> | 2009-09-06 19:35:12 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-06 19:35:12 +0200 |
| commit | f90dca555247651c580f879a22d932f378a34ce9 (patch) | |
| tree | 9804d294a92a32a38e5ac5cb3a6ced8ab1c5729e /app/controllers/search_controller.rb | |
| parent | 54543aeb8a1cebdffa96a6ac4b98baa6c1b8747d (diff) | |
added public search controller with corresponding view
Diffstat (limited to 'app/controllers/search_controller.rb')
| -rw-r--r-- | app/controllers/search_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb new file mode 100644 index 0000000..97ecdfd --- /dev/null +++ b/app/controllers/search_controller.rb | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | class SearchController < ApplicationController | ||
| 2 | def index | ||
| 3 | @page = Page.new | ||
| 4 | search_term = params[:search_term] | ||
| 5 | if search_term and not search_term.empty? | ||
| 6 | nodes = Node.search(params[:search_term]) | ||
| 7 | @results = nodes.map {|node| node.head} | ||
| 8 | end | ||
| 9 | end | ||
| 10 | |||
| 11 | end | ||
