diff options
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 12 |
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 |