<%= form_for(@tournament) do |f| %> <% if @tournament.errors.any? %>

<%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:

<% 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 %>


value=<%= value %>>

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