From 546b5895e7fe48d7f2e3c1032622805ee8fba090 Mon Sep 17 00:00:00 2001 From: tkimia Date: Sun, 6 Apr 2014 22:16:05 -0400 Subject: matches start --- app/views/matches/index.html.erb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 6fd831f..052d176 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -18,7 +18,15 @@ <%= match.id%> <%= match.name %> <%= link_to "Show", tournament_match_path(@tournament, match) %> - <%= submit_tag("Start Match") %> + <%# If user is the host, let them start the tournment %> + <% if @tournament.hosts.include?(current_user) %> + + <%= form_tag(tournament_match_path(@tournament, match), method: "put") do %> + + <%= submit_tag("Start Match") %> + <% end %> + <% end %> + <% end %> -- cgit v1.2.3-2-g168b