forked from fixin.me/fixin.me
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
<%= tabular_fields_for @unit do |form| %>
|
|
<%= tag.tr id: dom_id(@unit), class: "form", onkeydown: "processKey(event)",
|
|
data: {link_id: link_id} do %>
|
|
|
|
<td class="<%= class_names({subunit: @unit.base}) %>">
|
|
<%= form.text_field :symbol, form: :unit_form, required: true, autofocus: true, size: 12,
|
|
maxlength: @unit.class.columns_hash['symbol'].limit, autocomplete: "off" %>
|
|
</td>
|
|
<td>
|
|
<%= form.text_field :name, form: :unit_form, size: 30,
|
|
maxlength: @unit.class.columns_hash['name'].limit, autocomplete: "off" %>
|
|
</td>
|
|
<td>
|
|
<% unless @unit.base.nil? %>
|
|
<%= form.hidden_field :base_id, form: :unit_form %>
|
|
<%= form.number_field :multiplier, form: :unit_form, required: true, step: "any",
|
|
size: 10, autocomplete: "off" %>
|
|
<% end %>
|
|
</td>
|
|
|
|
<td class="actions">
|
|
<%= form.submit form: :unit_form %>
|
|
<%= image_link_to t(:cancel), "close-circle-outline", units_path, class: 'dangerous',
|
|
name: :cancel, onclick: render_turbo_stream('form_close', {link_id: link_id}) %>
|
|
</td>
|
|
<% end %>
|
|
<!-- TODO: display error_messages_for unit -->
|
|
<% end %>
|