From 0eaebadc3d943189bef136bbc2205897c106c507 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Fri, 7 Mar 2014 00:04:38 -0500 Subject: I changed a view --- app/views/matches/show.html.erb | 14 +++++++++++++- app/views/tournaments/_selected.html.erb | 2 +- app/views/tournaments/index.html.erb | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'app/views') 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 @@

Tournament: - <%= @match.tournament %> + <%= @match.tournament.id %>

@@ -8,5 +8,17 @@ <%= @match.name %>

+<% if @tournament.hosts.include?(current_user) %> + <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %> + + <%= submit_tag("Select winner") %> + <% end %> +<% end %> + <%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> | <%= link_to 'Back', tournament_matches_path %> diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 925e127..9b1b7f8 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -4,7 +4,7 @@ <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "statuss") %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> <% next %> <% end %>

diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 452d939..d4ef414 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -21,7 +21,7 @@ <% @tournaments.each do |tournament| %> - <%= tournament.game %> + <%= tournament.id %> <%= tournament.status %> <%= tournament.min_players_per_team %> <%= tournament.max_players_per_team %> -- cgit v1.2.3-54-g00ecf