diff options
Diffstat (limited to 'app/controllers')
-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 |