summaryrefslogtreecommitdiff
path: root/app/views/tournaments/_selected.html.erb
blob: 9b1b7f8a86a291fa6d3b0c6816e9809e7911a5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<%= form_for(@tournament) do |f| %>
  <%= render "common/error_messages", :target => @tournament %>
  <%= f.hidden_field(:game_id) %>

  <% @chosen = Game.find_by(params[:game]) %>
  <% @tournament.attributes.each do |name, value| %>
    <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %>
      <% next %>
    <% end %>
    <p>
        <%= f.label name %><br>
        <% if !@chosen.attributes[name].nil? %>
          <%= f.text_field(name, :value => @chosen.attributes[name] ) %>
        <% else %>
          <%= f.text_field name %>
        <% end  %>

    </p>

  <% end %>
  <%= f.submit %>
<% end %>