Run #create action

This commit is contained in:
2024-01-06 03:59:09 +01:00
parent ba3c2a99b9
commit ce4770a25c
6 changed files with 35 additions and 26 deletions

View File

@@ -9,7 +9,7 @@
<%= turbo_frame_tag 'unit_form_frame' %>
<table class="main items" id="units">
<table class="main items">
<thead>
<tr>
<th><%= User.human_attribute_name(:symbol).capitalize %></th>
@@ -20,23 +20,7 @@
<% end %>
</tr>
</thead>
<tbody>
<tr id="<%= dom_id(Unit.new) %>" is="turbo-frame"></tr>
<% Unit.each_with_level(@units) do |unit, level| %>
<tr>
<td class="link">
<%= link_to unit.symbol, edit_unit_path(unit), class: level > 0 ? 'subunit' : '' %>
</td>
<td><%= unit.name %></td>
<td class="number"><%= scientifize(unit.multiplier) unless unit.multiplier == 1 %></td>
<% if current_user.at_least(:active) %>
<td class="actions">
<%= image_button_to t(".delete_unit"), "delete-outline", unit_path(unit),
method: :delete %>
</td>
<% end %>
</tr>
<% end %>
<tbody id="units" is="turbo-frame">
<%= render partial: 'index' %>
</tbody>
</table>