%= error_messages_for @measurement %>
<%= f.select :source_id, source_options, {required: false, include_blank: t('.null_source')} %>
<%= f.text_field :name, size: 40, required: true %>
<% @measurement.readouts.each_with_index do |r, index| %> <%= f.fields_for 'readouts_attributes', r, index: '' do |ff| %><%= ff.select :quantity_id, quantity_options, {include_blank: true, label: (index > 0 ? '' : :field_readouts)} %> <%= ff.number_field :value, {size: 8, step: :any, label: ''} %> <%= ff.select :unit_id, unit_options, {label: ''} %> <%= ff.check_box :_destroy, {style: "display:none", label: ''} %> <%= link_to t(".button_delete_readout"), '#', class: 'icon icon-del', style: (@measurement.readouts.length > 1 ? "" : "display:none"), onclick: "deleteReadout(); return false;" %>
<% end %> <% end %><%= link_to t(".button_add_readout"), '#', class: 'icon icon-add', onclick: 'addReadout(); return false;' %>