1
0
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:
2016-03-02 14:08:14 +00:00
parent 817e1fb0c1
commit 9bd36d2cb0
4 changed files with 46 additions and 10 deletions

View File

@@ -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