summaryrefslogtreecommitdiff
path: root/app/views/matches/_form.html.erb
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-03-25 17:30:10 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-03-25 17:30:10 -0400
commit0c22c4bd9a0b4a0b0ff5840c1af41c0b320e3529 (patch)
tree2fc2082814e513ec5d68b22e7fa07d268df6d788 /app/views/matches/_form.html.erb
parent8435c0a5ec9889a9da6ede2e24c044d64b279095 (diff)
added match status
Diffstat (limited to 'app/views/matches/_form.html.erb')
-rw-r--r--app/views/matches/_form.html.erb23
1 files changed, 21 insertions, 2 deletions
diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb
index 015aed0..727c002 100644
--- a/app/views/matches/_form.html.erb
+++ b/app/views/matches/_form.html.erb
@@ -1,5 +1,20 @@
-<%= form_for([@tournament, @tournament.matches.build]) do |f| %>
-
+<%= 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 %>
+
+ <div class="field">
+ <%= f.label :status %><br>
+ <%= f.number_field :status %>
+ </div>
<div class="field">
<%= f.label :tournament_id %><br>
<%= f.text_field :tournament_id %>
@@ -8,6 +23,10 @@
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
+ <div class="field">
+ <%= f.label :winner_id %><br>
+ <%= f.text_field :winner_id %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>