forked from fixin.me/fixin.me
Unit#edit action
This commit is contained in:
parent
a7f80a575c
commit
5ea1f87824
@ -1,6 +1,6 @@
|
||||
<tr id="<%= dom_id(unit) %>">
|
||||
<td class="<%= class_names('link', {subunit: unit.base}) %>">
|
||||
<%= link_to unit.symbol, edit_unit_path(unit) %>
|
||||
<%= link_to unit.symbol, edit_unit_path(unit), data: {turbo_stream: true} %>
|
||||
</td>
|
||||
<td><%= unit.name %></td>
|
||||
<td class="number"><%= scientifize(unit.multiplier) if unit.multiplier %></td>
|
||||
|
@ -1 +0,0 @@
|
||||
/var/www/app/views/units/new.html.erb
|
10
app/views/units/edit.turbo_stream.erb
Normal file
10
app/views/units/edit.turbo_stream.erb
Normal file
@ -0,0 +1,10 @@
|
||||
<%# TODO: make sure turbo_stream layout is used in new/edit %>
|
||||
<%= turbo_stream.disable :add_unit %>
|
||||
<%= turbo_stream.disable_all 'td.actions .button' %>
|
||||
|
||||
<%= turbo_stream.replace @unit, partial: 'form' %>
|
||||
|
||||
<%= turbo_stream.update :unit_form_frame do %>
|
||||
<%= form_with model: @unit, html: {id: :unit_form} do %>
|
||||
<% end %>
|
||||
<% end %>
|
Loading…
x
Reference in New Issue
Block a user