sanger/sequencescape

View on GitHub
app/views/barcode_printers/__edit_barcode_printer.html.erb

Summary

Maintainability
Test Coverage

<%= form_for(@barcode_printer) do |f| %>
  <%= render_error_messages(@barcode_printer) %>
  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :active %><br />
    <%= f.check_box :active %>
  </p>
  <p>
    <%= f.label :printer_type %><br />
    <% BarcodePrinter.printer_types.each_with_index do |(k, v), index| %>
      <%= label_tag "barcode_printer_printer_type_#{k}", k %>
      <%= f.radio_button :printer_type, k, checked: index == 0 %>
    <% end %>
  </p>
  <p>
    <label for="barcode_printer_type_id" >Barcode printer type</label><br />
    <%= select_tag 'barcode_printer_type_id',options_from_collection_for_select(BarcodePrinterType.all, 'id', 'name') %>
  </p>
  <p>
    <%= f.submit "Submit" %>
  </p>
<% end %>