forked from fixin.me/fixin.me
9c51887024
Stretch inputs to column width in place of fixed sizing. Set minimum column widths for columns with form inputs. Simplify table operations by removing `thead` and adding sentinel. Manage empty table display with CSS only.
16 lines
525 B
Plaintext
16 lines
525 B
Plaintext
<% target_id = dom_target(:new, @unit.base || :unit) %>
|
|
<% ids = {row: target_id,
|
|
hidden_row: nil,
|
|
link: dom_target(target_id, :link),
|
|
form_tag: dom_target(target_id, :form)} %>
|
|
|
|
<%= turbo_stream.disable ids[:link] -%>
|
|
|
|
<%= turbo_stream.append_all 'body' do %>
|
|
<%- tabular_form_with model: @unit, html: {id: ids[:form_tag]} do |form| %>
|
|
<%= form.hidden_field :base_id if @unit.base_id? %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= turbo_stream.after @unit.base || :unit_, partial: 'form', locals: ids %>
|