%= form_for(@tournament) do |f| %> <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> <% @game = Game.find(params[:game]) %> <% @tournament.attributes.each do |name, value| %> <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") or (name == "set_rounds") %> <% next %> <% end %>
<%= f.label name %>
<% if !@game.attributes[name].nil? %>
<%= f.text_field(name, :value => @game.attributes[name] ) %>
<% else %>
<%= f.text_field name %>
<% end %>