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

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

<% end %>
<%= f.label :name %>
<%= f.text_field :name %>
<% if can? :manage, @wrestler.tournament %> <% if @tournament %> <%= f.hidden_field :school_id, :value => @school.id %> <% else %>
<%= f.label 'School' %>
<%= f.collection_select :school_id, @school.tournament.schools, :id, :name %>
<% end %> <% end %>
<%= f.label 'Weight Class' %>
<%= f.collection_select :weight_id, @weights, :id, :max %>
<%= f.label "Season Wins" %>
<%= f.number_field :season_win %>
<%= f.label "Season Losses" %>
<%= f.number_field :season_loss %>
<%= f.label "Seed Criteria" %>
<%= f.text_field :criteria %>
<%= f.label "Check box if extra" %> <%= f.check_box :extra %>


<%= f.submit :class=>"btn btn-success"%>
<% end %> <% if can? :manage, @wrestler.tournament %>

Swap Bracket Position

<%= form_for(Wrestler.new, url: swap_wrestlers_path(@wrestler.tournament)) do |f| %> <%= f.hidden_field :originalId, :value => @wrestler.id %>
<%= f.label 'Swap With' %>
<%= f.collection_select :swapId, @wrestler.weight.wrestlers, :id, :name %>

<%= submit_tag "Swap", :class=>"btn btn-success"%> <% end %> <% end %>