forked from fixin.me/fixin.me
Single select form without action buttons
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<%= turbo_stream.remove dom_id(@quantity, :new, :readout) %>
|
||||
<%= turbo_stream.disable_all 'button[name="discard"]' if @prev_quantities.one? %>
|
||||
<%= turbo_stream.update_all "#id option[value=\"#{@quantity.id}\"]",
|
||||
quantity_option_text(@quantity, false) %>
|
||||
<%= turbo_stream.enable_all "select.quantity option[value='#{@quantity.id}']" %>
|
||||
<%= render partial: 'form_repath' %>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<%= render partial: 'form_repath' %>
|
||||
<%# is .one? proper condition? can @readouts be empty? %>
|
||||
<%= turbo_stream.enable_all 'button[name="discard"]' if @prev_quantities.one? %>
|
||||
<%# TODO: disable Add actions accordingly (e.g. disable Children if childless or all
|
||||
children already added), then disable option once all actions unavailable %>
|
||||
<% @readouts.each do |r| %>
|
||||
<%= turbo_stream.update_all "#id option[value=\"#{r.quantity_id}\"]",
|
||||
quantity_option_text(r.quantity, true) %>
|
||||
<%= turbo_stream.disable_all "select.quantity option[value='#{r.quantity_id}']" %>
|
||||
<% end %>
|
||||
<%= turbo_stream.before :readouts_form do %>
|
||||
<%= render partial: 'form', collection: @readouts, as: :readout %>
|
||||
|
||||
Reference in New Issue
Block a user