<%= form_for @match, html: { class: 'square' } do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :contest_id %>
<%= f.label :contester1_id, "Team #1" %>
<%= f.select :contester1_id, @match.contest.contesters.active.collect{|c| ["#{c.team.name}", c.id]} %>
<%= f.label :contester2_id, "Team #2" %>
<%= f.select :contester2_id, @match.contest.contesters.active.collect{|c| ["#{c.team.name}", c.id]} %>
<%= f.label :map1_id, "Map #1" %>
<%= f.select :map1_id, @match.contest.maps.basic.collect{|m| [m.name, m.id]} %>
<%= f.label :map2_id, "Map #2" %>
<%= f.select :map2_id, @match.contest.maps.basic.collect{|m| [m.name, m.id]} %>
<%= f.label :match_time %>
<%= f.datetime_select :match_time, datetime_separator: '', time_separator: '' %>
<%= f.label :referee_id %>
<%= f.select :referee_id, Group.find(Group::REFEREES).users.collect{|u| [u, u.id]}, {:include_blank => true} %>
<%= f.label :week_id %>
<%= f.select :week_id, @match.contest.weeks.ordered.collect{|w| [w, w.id]}, {:include_blank => true} %>
<%= f.submit 'Save Match' %>
<% end %>