summaryrefslogtreecommitdiff
path: root/app/views/tournaments/_form.html.erb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-27 03:04:09 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-27 03:04:09 -0400
commit987b3e0d151d58c6b44e16e3ec4d13ce7f303fe7 (patch)
tree24971fe4b80e1dd4b6d27b9041945ffb7163748d /app/views/tournaments/_form.html.erb
parent125d861972b9fcd99147d67b0e8fe4102f96190e (diff)
get the tournament creation page complete
Diffstat (limited to 'app/views/tournaments/_form.html.erb')
-rw-r--r--app/views/tournaments/_form.html.erb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index 78ceca4..b8d6fc1 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -83,9 +83,9 @@
<fieldset><legend>Stages</legend>
<label for="num_stages">Number of tournament stages</label>
- <input type="number" name="num_stages" min="1">
+ <input type="number" name="num_stages" min="1" value="<%= params[:num_stages] ? params[:num_stages].to_i : 1 %>">
<% for i in 1..(params[:num_stages].to_i) do %>
- <%= fields_for "tournament[stages][#{i}]", @tournament.stages do |stage_fields| %>
+ <%= fields_for "tournament[stages][#{i}]", @tournament.stages[i] do |stage_fields| %>
<fieldset><legend>Stage <%= i %></legend>
<%= stage_fields.label :scheduling_method %>
<%= stage_fields.select(:scheduling_method, @tournament.scheduling_methods.map{|method| [method.humanize, method]}) %>