%= form_for(@tournament) do |f| %> <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> <% @tournament.attributes.each do |name, value| %> <% if (name == "randomized_teams") or(name == "max_teams_per_match") or (name == "max_players_per_team") or (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") or (name == "set_rounds") %> <% next %> <% end %>
<%= f.label name %>
<% unless @tournament.game.attributes[name].nil? %>
<% if name == "sampling_method" %>
<%= f.select( name, Tournament.sampling_methods) %>
<% else %>
<%= f.text_field(name, :value => @tournament.game.attributes[name] ) %>
<% end %>
<% else %>
<%= f.select( name, Tournament.scoring_methods) %>
<% end %>