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
557 B
Plaintext
16 lines
557 B
Plaintext
<% target_id = dom_target(:new, @quantity.parent || :quantity) %>
|
|
<% 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: @quantity, html: {id: ids[:form_tag]} do |form| %>
|
|
<%= form.hidden_field :parent_id if @quantity.parent_id? %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= turbo_stream.after @quantity.parent || :quantity_, partial: 'form', locals: ids %>
|