%= error_messages_for @target %>
<% @target.thresholds.each_with_index do |t, index| %> <%= f.fields_for 'thresholds_attributes', t, index: '' do |ff| %> <% if index == 0 %> <%= ff.select :quantity_id, quantity_options, {include_blank: true, required: true, label: :field_target} %> <%= f.select :condition, condition_options, required: true %> <% end %> <%= ff.hidden_field :id %> <%= ff.number_field :value, {size: 8, step: :any, label: ''} %> <% if index == 0 %> <%= ff.select :unit_id, unit_options, {label: ''} %> <% end %> <% end %> <% end %> <%= link_to t(".button_delete_target"), '#', class: 'icon icon-del', onclick: "deleteTarget(); return false;" %>
<%= link_to t(".button_new_target"), '#', class: 'icon icon-add', onclick: 'newTarget(); return false;' %>