summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-22 18:17:47 -0400
committernfoy <nfoy@purdue.edu>2014-04-22 18:17:47 -0400
commit7f452e8d99a86af2e3dc2f743158951092aedeb7 (patch)
tree103f3cb57b05c5a580c3a5152a2a97f5a8070d1e /app/controllers/search_controller.rb
parent7fe1f6a809d68648bede431b84692bf7d8bb0c01 (diff)
parent7deb9c1c7acadf9a5b638313f51ba9dc60624672 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index ee61487..51aee9e 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -1,2 +1,15 @@
class SearchController < ApplicationController
+
+ def go
+ @query = params[:query]
+
+ if (@query.nil?) then
+ return
+ end
+
+ @tournaments = Tournament.where("name LIKE '%#{@query}%'")
+ @players = User.where("name LIKE '%#{@query}%'")
+
+ end
+
end