mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-31 03:25:45 +00:00
Added a search to both api and frontend
This commit is contained in:
@@ -6,7 +6,11 @@ class ApiController < ApplicationController
|
||||
end
|
||||
|
||||
def tournaments
|
||||
@tournaments = Tournament.all
|
||||
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 tournament
|
||||
|
||||
Reference in New Issue
Block a user