summaryrefslogtreecommitdiff
path: root/app/views/matches/show.html.erb
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-03-07 00:04:38 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-03-07 00:04:38 -0500
commit0eaebadc3d943189bef136bbc2205897c106c507 (patch)
treece9d62f710700a1b4d031404ad880ab1ec32aa02 /app/views/matches/show.html.erb
parente7562550fdaff859b0ead5a37e58c5f2b920ca80 (diff)
I changed a view
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r--app/views/matches/show.html.erb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index e95cd07..b31c989 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,6 +1,6 @@
<p>
<strong>Tournament:</strong>
- <%= @match.tournament %>
+ <%= @match.tournament.id %>
</p>
<p>
@@ -8,5 +8,17 @@
<%= @match.name %>
</p>
+<% if @tournament.hosts.include?(current_user) %>
+ <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %>
+ <ul>
+ <% @match.teams.each do |team| %>
+ <li><label><input type="radio" name="winner" value="<%= team.id %>">
+ <%= team.users.collect{|u| u.user_name}.join(", ") %></label></li>
+ <% end %>
+ </ul>
+ <%= submit_tag("Select winner") %>
+ <% end %>
+<% end %>
+
<%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> |
<%= link_to 'Back', tournament_matches_path %>