mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 22:44:14 +00:00
See bracket size from tournament view.
This commit is contained in:
@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
|
|||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
has_many :wrestlers, dependent: :destroy
|
has_many :wrestlers, dependent: :destroy
|
||||||
|
|
||||||
attr_accessor :pools
|
attr_accessor :pools, :bracket_size
|
||||||
|
|
||||||
def generatePool
|
def generatePool
|
||||||
@wrestlers = Wrestler.where(weight_id: self.id)
|
@wrestlers = Wrestler.where(weight_id: self.id)
|
||||||
@@ -29,5 +29,10 @@ class Weight < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bracket_size
|
||||||
|
@wrestlers = Wrestler.where(weight_id: self.id)
|
||||||
|
return @wrestlers.size
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Weight Class</th>
|
<th>Weight Class</th>
|
||||||
|
<th>Bracket Size</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -77,6 +78,7 @@
|
|||||||
<% @weights.each do |weight| %>
|
<% @weights.each do |weight| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= weight.max %></td>
|
<td><%= weight.max %></td>
|
||||||
|
<td><%= weight.bracket_size %></td>
|
||||||
<td><%= link_to 'Show', weight, :class=>"btn" %>
|
<td><%= link_to 'Show', weight, :class=>"btn" %>
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= link_to 'Edit', edit_weight_path(weight), :class=>"btn" %>
|
<%= link_to 'Edit', edit_weight_path(weight), :class=>"btn" %>
|
||||||
|
|||||||
Reference in New Issue
Block a user