summaryrefslogtreecommitdiff
path: root/app/views/tournaments/_selected.html.erb
blob: e89550ee81cc66de99de13b1c7c2ca531f9c5694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<%= 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 %>
    <p>
      <%= f.label name %><br>
      <% 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  %>
    </p>
  <% end %>
  <%= f.submit %>
<% end %>