Simple search implementation
This commit is contained in:
parent
b2c13bdd77
commit
5d2bd5ec3a
13 changed files with 127 additions and 4 deletions
12
app/controllers/search_controller.rb
Normal file
12
app/controllers/search_controller.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue