1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-12 08:18:44 +00:00

Added stats to wrestler -> show

This commit is contained in:
2017-11-14 07:43:06 -05:00
parent 62faa4f307
commit 0c9af7fcb3
2 changed files with 28 additions and 16 deletions

View File

@@ -134,5 +134,11 @@ class Match < ActiveRecord::Base
end end
end end
def list_w2_stats
"#{w2_name}: #{w2_stat}"
end
def list_w1_stats
"#{w1_name}: #{w1_stat}"
end
end end

View File

@@ -39,6 +39,12 @@
<h4>Matches</h4> <h4>Matches</h4>
<br> <br>
<% @wrestler.allMatches.each do |m| %> <% @wrestler.allMatches.each do |m| %>
<div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= @wrestler.resultByBout(m.bout_number) %></div> <div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= @wrestler.resultByBout(m.bout_number) %></div>
<% if m.w1_stat || m.w2_stat %>
<div>Stats:</div>
<div><%= m.list_w1_stats %></div>
<div><%= m.list_w2_stats %></div>
</br>
<% end %>
<% end %> <% end %>
<% end %> <% end %>