diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-07 01:25:12 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-07 01:25:12 -0500 |
commit | f69fcc28596700c1a875068b7cb616d6eb40e6df (patch) | |
tree | c11b97401a620f2dd7df5ae4b9645111065b0a8a /app/views/matches | |
parent | fd213819fa004209fc466b19ee65d83b1f918068 (diff) |
It is 1:30 AM
Diffstat (limited to 'app/views/matches')
-rw-r--r-- | app/views/matches/show.html.erb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index f5a3686..3a7e7a6 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -8,11 +8,11 @@ <%= @match.name %> </p> -<% if @tournament.hosts.include?(current_user) %> - <%= form_for(@match, method: "put") do |f| %> +<% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> + <%= form_for([@tournament, @match], method: "put") do |f| %> <ul> <% @match.teams.each do |team| %> - <li><label><%= f.radio_button(:winner, team.id) %> + <li><label><%= f.radio_button(:winner_id, team.id) %> <%= team.users.collect{|u| u.user_name}.join(", ") %></label></li> <% end %> </ul> @@ -20,15 +20,11 @@ <% end %> <% end %> -<%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> | -<%= link_to 'Back', tournament_matches_path %> - <% unless @match.winner.nil? %> <p> <strong>Winner:</strong> <%= @match.winner.users.collect{|u| u.user_name}.join(", ") %> </p> <% end %> -<%= link_to 'Edit', edit_match_path(@match) %> | -<%= link_to 'Back', matches_path %> +<%= link_to 'Back', tournament_matches_path %> |