summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-16 01:14:39 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-16 01:14:39 +0200
commit5d2bd5ec3a6d1c9ceb985e0af684f162926b0555 (patch)
tree08491064a542f9a9294b86ab7f67c7d8919040dc /app/controllers/search_controller.rb
parentb2c13bdd777838e9837b12e56854e152b8a13f0c (diff)
downloadgitlab-ce-5d2bd5ec3a6d1c9ceb985e0af684f162926b0555.tar.gz
Simple search implementation
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
new file mode 100644
index 00000000000..8a452fe0914
--- /dev/null
+++ b/app/controllers/search_controller.rb
@@ -0,0 +1,12 @@
+class SearchController < ApplicationController
+ def show
+ query = params[:search]
+ if query.blank?
+ @projects = []
+ @merge_requests = []
+ else
+ @projects = Project.search(query).limit(10)
+ @merge_requests = MergeRequest.search(query).limit(10)
+ end
+ end
+end