forked from fixin.me/fixin.me
19 lines
547 B
Plaintext
19 lines
547 B
Plaintext
<%= turbo_stream.disable :add_unit %>
|
|
<%# TODO: disable only form-opening actions %>
|
|
<%= turbo_stream.disable_all 'td.actions .button' %>
|
|
|
|
<% if @unit.errors.present? %>
|
|
<%= turbo_stream.replace @unit, partial: 'form' %>
|
|
<% else %>
|
|
<% if @unit.base.nil? %>
|
|
<%= turbo_stream.prepend :units, partial: 'form' %>
|
|
<% else %>
|
|
<%= turbo_stream.after @unit.base, partial: 'form' %>
|
|
<% end %>
|
|
|
|
<%= turbo_stream.update :unit_form_frame do %>
|
|
<%= form_with model: @unit, html: {id: :unit_form} do %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|