From e10bf58ec059ec263c1d1a9dcac608475377868a Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 6 Mar 2014 20:39:05 -0500 Subject: matches routed --- app/views/matches/_form.html.erb | 15 ++------------- app/views/matches/index.html.erb | 2 +- app/views/matches/new.html.erb | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) (limited to 'app/views/matches') 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? %> -
-

<%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:

- - -
- <% end %> - +<%= form_for([@tournament, @tournament.matches.build]) do |f| %> +
<%= f.label :tournament_id %>
<%= f.text_field :tournament_id %> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 0742770..d258638 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -26,4 +26,4 @@
-<%= 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 %> + -- cgit v1.2.3-2-g168b From e4fe0192a332a324dd207b370252669c88216488 Mon Sep 17 00:00:00 2001 From: nfoy Date: Thu, 6 Mar 2014 21:15:12 -0500 Subject: matches now belong to tournament --- app/views/matches/index.html.erb | 8 ++++---- app/views/matches/show.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/views/matches') diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d258638..d635834 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -12,13 +12,13 @@ - <% @matches.each do |match| %> + <% @tournament.matches.each do |match| %> <%= match.tournament %> <%= match.name %> - <%= link_to 'Show', match %> - <%= link_to 'Edit', edit_match_path(match) %> - <%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= link_to 'Show', tournament_match_path(@tournament, match) %> + <%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %> + <%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> 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 %>

-<%= 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 %> -- cgit v1.2.3-2-g168b