diff options
author | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-22 19:13:01 -0400 |
---|---|---|
committer | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-22 19:13:01 -0400 |
commit | 38c2ff9637018d88db7083c76c133da3a72f4c31 (patch) | |
tree | ae5c381e7fe9493abfe8fa6c700df64648246fe2 /app/controllers/search_controller.rb | |
parent | 3e86ffe1113a096541ea94567bffee79368fb863 (diff) | |
parent | 5c6d6dca48bf3d54f145e859e6d4c8b1befe1f09 (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.rb | 13 |
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 |