diff options
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 9da649d..51aee9e 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -3,10 +3,12 @@ class SearchController < ApplicationController def go @query = params[:query] - if (@query.nil?) return; + if (@query.nil?) then + return + end - @tournaments = Tournament.where("name LIKE '#{@query}'") - @players = User.where("name LIKE '#{@query}") + @tournaments = Tournament.where("name LIKE '%#{@query}%'") + @players = User.where("name LIKE '%#{@query}%'") end |