1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Fixed up_matches and results to filter by tournament_id

This commit is contained in:
Jacob Cody Wimer
2014-01-30 10:03:31 -05:00
parent 092e00be98
commit f618b0aa7c

View File

@@ -8,18 +8,19 @@ class StaticPagesController < ApplicationController
@tournament = Tournament.find(params[:tournament])
end
if @tournament
@matches = Weight.where(tournament_id: @tournament.id)
@matches = Match.where(tournament_id: @tournament.id)
end
@matches = Match.where(finished: nil)
@matches = @matches.where(finished: nil)
end
def results
if params[:tournament]
@tournament = Tournament.find(params[:tournament])
end
if @tournament
@matches = Weight.where(tournament_id: @tournament.id)
@matches = Match.where(tournament_id: @tournament.id)
end
@matches = Match.where(finished: 1)
@matches = @matches.where(finished: 1)
end
def brackets