%= form_for(@mat) do |f| %>
<% if @mat.errors.any? %>
<%= pluralize(@mat.errors.count, "error") %> prohibited this mat from being saved:
<% @mat.errors.full_messages.each do |msg| %>
- <%= msg %>
<% end %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name %>
<% if @tournament_field %>
<%= f.hidden_field :tournament_id, :value => @tournament_field %>
<% else %>
<%= f.label 'Tournament' %>
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
<% end %>
<%= f.submit %>
<% end %>