1 2 3 4 5 6 7 8 9 10 11 12 13 14 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