<div class="row">
<div class="col-md-6">
<%= form_for(@feedback) do |f| %>
  <%= render partial: 'form_errors', locals: { what: @feedback } %>

  <% if @feedback.new_record? %>
    <%# When submitting new feedback (as opposed to an update), the order_id parameter is required. Updates don't need to specify order_id. %>
    <%= f.hidden_field(:order_id) %>
    <div class="form-group">
      <div class="radio">
        <label>
          <%= f.radio_button(:rating, :positive) %> <%= image_tag 'happy_face1.gif', class: 'faceimage' %> Positive
        </label>
      </div>
      <div class="radio">
        <label>
          <%= f.radio_button(:rating, :neutral) %> <%= image_tag 'neutral_face1.gif', class: 'faceimage' %> Neutral
        </label>
      </div>
      <div class="radio">
        <label>
          <%= f.radio_button(:rating, :negative) %> <%= image_tag 'sad_face1.gif', class: 'faceimage' %> Negative
        </label>
      </div>
    </div>
  <%end%>

  <%# Updates can only modify the text message, not the rating. Can't remember the exact reasons for designing it this way.
      Maybe reason is to prevent someone changing historical positive feedback to negative based on a single bad sale. %>
  <div class="form-group">
    <%= f.label :feedback %>
    <%= f.text_area :feedback, rows: 5, class: 'form-control' %>
  </div>
  <div class="actions">
    <%= f.submit class: 'btn btn-primary' %>
  </div>
<% end %>
</div>
</div>
