summaryrefslogtreecommitdiff
path: root/app/views/tournaments
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-27 13:10:42 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-27 13:14:11 -0400
commita7a68011785381c3680d81e0eaf29964f0007fe1 (patch)
treee038bfe70f1ff3382b1bb7c6a757db1362fbeb3a /app/views/tournaments
parent347e339f7c8327b37d8a416073dc12fc3a78c895 (diff)
touch up the tournaments form
Diffstat (limited to 'app/views/tournaments')
-rw-r--r--app/views/tournaments/_form.html.erb15
1 files changed, 7 insertions, 8 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index b8d6fc1..95bb7c7 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -49,7 +49,7 @@
</fieldset>
<fieldset><legend>Settings</legend>
- <%= fields_for "tournament[settings]", @tournament.settings do |setting_fields| %>
+ <%= f.fields_for :settings do |setting_fields| %>
<% (@tournament.settings.empty? ? @tournament.game.settings : @tournament.settings).each do |setting| %><p>
<% name = setting.name.parameterize.underscore %>
<%= setting_fields.label name %>
@@ -81,20 +81,19 @@
<% end %>
</fieldset>
- <fieldset><legend>Stages</legend>
+ <%= f.fields_for :stages do |stages_fields| %><fieldset><legend>Stages</legend>
<label for="num_stages">Number of tournament stages</label>
- <input type="number" name="num_stages" min="1" value="<%= params[:num_stages] ? params[:num_stages].to_i : 1 %>">
+ <input type="number" name="num_stages" min="1" value="<%= params[:num_stages].to_i %>">
<% for i in 1..(params[:num_stages].to_i) do %>
- <%= fields_for "tournament[stages][#{i}]", @tournament.stages[i] do |stage_fields| %>
- <fieldset><legend>Stage <%= i %></legend>
+ <%= stages_fields.fields_for i.to_s 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]}) %>
<%= stage_fields.label :seeding_method %>
<%= stage_fields.select(:seeding_method, @tournament.seeding_methods.map{|method| [method.humanize, method]}) %>
- </fieldset>
- <% end %>
+ </fieldset><% end %>
<% end %>
- </fieldset>
+ </fieldset><% end %>
+
<%= f.submit %>
<%# render 'stages' %>