%= form_for(@tournament) do |f| %>
<% if @tournament.errors.any? %>
<%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:
<% @tournament.errors.full_messages.each do |msg| %>
<%= msg %>
<% end %>
<% end %>
<%# this is the dynamic script to output fields to the form %>
<% @chosen = Game.find(@game) %>
<% @chosen.attributes.each do |name, value| %>
<% if name == "id" %>
<% next %>
<% end %>
<% if name == "created_at" %>
<% break %>
<% end %>