<%= form_for(@weight) do |f| %>
  <% if @weight.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@weight.errors.count, "error") %> prohibited this weight from being saved:</h2>

      <ul>
      <% @weight.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :max %><br>
    <%= f.number_field :max, step: :any %>
  </div>

  <% if @weight %>
      <%= f.hidden_field :tournament_id, :value => @tournament.id %>
  <% end %>
  <br>
  <div class="actions">
    <%= f.submit 'Submit', :class=>"btn btn-success" %>
  </div>
<% end %>
