1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-30 19:22:21 +00:00

Added back links to brackets and weights static_pages

This commit is contained in:
Jacob Cody Wimer
2014-01-24 09:36:26 -05:00
parent 6506cea6a3
commit ec17963c28
3 changed files with 7 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ class StaticPagesController < ApplicationController
def brackets
if params[:weight]
@weight = Weight.find(params[:weight])
@tournament = Tournament.find(@weight.tournament_id)
@wrestlers = Wrestler.where(weight_id: @weight.id)
@bracket_size = Wrestler.where(weight_id: @weight.id).count
@seed1 = Wrestler.where(weight_id: @weight.id, original_seed: 1).first

View File

@@ -1,3 +1,6 @@
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
<br>
<br>
<% if @bracket_size == 10 %>
<%= render 'man10' %>
<% elsif @bracket_size == 9 %>

View File

@@ -1,3 +1,6 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
<br>
<% @weights.each do |weight| %>
<%= link_to "#{weight.max}" , "/static_pages/brackets?weight=#{weight.id}" %>
<br>