diff options
| author | hukl <contact@smyck.org> | 2009-09-06 21:51:31 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-06 21:51:31 +0200 |
| commit | 8f2dc36616548650000308ebc8b1f9e2947c0ef9 (patch) | |
| tree | 79f1226c6f7646b1bbe57634c848e44d426bd01f /app/controllers/search_controller.rb | |
| parent | 5c90701cdf3ad475840a76f096f1b74ff68fbd0f (diff) | |
| parent | d555e1b27df1096e8899f2e50c8d6421f4c1cca3 (diff) | |
Merge branch 'public_search'
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 | ||
