%= tabular_fields_for @quantity, form: form_tag do |form| %>
<%- tag.tr id: row, class: "form",
data: {controller: 'form', action: 'keydown->form#processKey',
link: link, form: form_tag, hidden_row: hidden_row} do %>
<%= form.text_field :name, required: true, autofocus: true, size: 20 %>
|
<%= form.text_area :description, cols: 30, rows: 1, escape: false %>
|
<%= form.collection_select :default_unit_id, @user_units, :id,
->(u){ sanitize(' ' * (u.base_id? ? 1 : 0) + u.symbol) },
{include_blank: true}, onchange: "this.dataset.changed = ''" %>
|
<%= form.button %>
<%= image_link_to t(:cancel), "close-outline", quantities_path, class: 'dangerous',
name: :cancel, data: {action: 'click->form#cancel'} %>
|
|
<% end %>
<% end %>