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

View for no matches

This commit is contained in:
2015-04-27 09:57:08 -04:00
parent 9c5c12c413
commit 525a2948de
2 changed files with 9 additions and 1 deletions

View File

@@ -8,6 +8,9 @@ class StaticPagesController < ApplicationController
@tournament = Tournament.find(params[:tournament])
end
if @tournament
if @tournamnet.matches == nil
render 'noMatches'
end
@matches = @tournament.upcomingMatches
end
end
@@ -37,9 +40,12 @@ class StaticPagesController < ApplicationController
@weight = Weight.find(params[:weight])
@bracketType = @weight.pool_bracket_type
@tournament = Tournament.find(@weight.tournament_id)
@matches = @tournament.upcomingMatches.select{|m| m.weight_id == @weight.id}
@matches = @tournament.matches.select{|m| m.weight_id == @weight.id}
@wrestlers = Wrestler.where(weight_id: @weight.id)
@pools = @weight.poolRounds(@matches)
if @matches == nil or @wrestlers == nil
render 'noMatches'
end
end
end

View File

@@ -0,0 +1,2 @@
<h1>No Matches</h1>
<p>This view will not render until matches have been generated by the tournament director.</p>