summaryrefslogtreecommitdiff
path: root/app/views/matches
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/matches')
-rw-r--r--app/views/matches/_form.html.erb15
-rw-r--r--app/views/matches/index.html.erb10
-rw-r--r--app/views/matches/new.html.erb2
-rw-r--r--app/views/matches/show.html.erb4
4 files changed, 10 insertions, 21 deletions
diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb
index c5f1ba8..015aed0 100644
--- a/app/views/matches/_form.html.erb
+++ b/app/views/matches/_form.html.erb
@@ -1,16 +1,5 @@
-<%= form_for(@match) do |f| %>
- <% if @match.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:</h2>
-
- <ul>
- <% @match.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
-
+<%= form_for([@tournament, @tournament.matches.build]) do |f| %>
+
<div class="field">
<%= f.label :tournament_id %><br>
<%= f.text_field :tournament_id %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 0742770..d635834 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -12,13 +12,13 @@
</thead>
<tbody>
- <% @matches.each do |match| %>
+ <% @tournament.matches.each do |match| %>
<tr>
<td><%= match.tournament %></td>
<td><%= match.name %></td>
- <td><%= link_to 'Show', match %></td>
- <td><%= link_to 'Edit', edit_match_path(match) %></td>
- <td><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+ <td><%= link_to 'Show', tournament_match_path(@tournament, match) %></td>
+ <td><%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %></td>
+ <td><%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
@@ -26,4 +26,4 @@
<br>
-<%= link_to 'New Match', new_match_path %>
+<%= link_to 'New Match', new_tournament_match_path %>
diff --git a/app/views/matches/new.html.erb b/app/views/matches/new.html.erb
index bd4c78c..9ac669f 100644
--- a/app/views/matches/new.html.erb
+++ b/app/views/matches/new.html.erb
@@ -2,4 +2,4 @@
<%= render 'form' %>
-<%= link_to 'Back', matches_path %>
+
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index 9c9cbb4..e95cd07 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -8,5 +8,5 @@
<%= @match.name %>
</p>
-<%= link_to 'Edit', edit_match_path(@match) %> |
-<%= link_to 'Back', matches_path %>
+<%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> |
+<%= link_to 'Back', tournament_matches_path %>