mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-04 22:03:49 +00:00
Added tournament search
This commit is contained in:
@@ -80,7 +80,11 @@ class TournamentsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@tournaments = Tournament.all.sort_by{|t| t.daysUntil}
|
||||
if params[:search]
|
||||
@tournaments = Tournament.search(params[:search]).order("created_at DESC")
|
||||
else
|
||||
@tournaments = Tournament.all.sort_by{|t| t.daysUntil}.first(20)
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user