search_controller.rb 292 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
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