Update Measurements#new form pathnames on actions

This commit is contained in:
2025-05-07 00:24:05 +02:00
parent 9dbcfddf98
commit ef3484dfdf
11 changed files with 61 additions and 37 deletions

View File

@@ -6,15 +6,14 @@
<%= select_tag :id, options_from_collection_for_select(
@quantities, :id, ->(q){ sanitize('&emsp;' * q.depth + q.name) }
), form: :new_readouts_form %>
<% common_options = {form: :new_readouts_form, formaction: new_measurement_path,
formmethod: :get, formnovalidate: true,
data: {turbo_stream: true}} %>
<%= image_button_tag t('.new_quantity'), 'plus-outline', name: :scope,
**common_options -%>
<%= image_button_tag t('.new_children'), 'plus-multiple-outline', name: :scope,
value: :children, **common_options -%>
<%= image_button_tag t('.new_subtree'), 'plus-multiple-outline', name: :scope,
value: :subtree, **common_options -%>
<% common_options = {form: :new_readouts_form, formmethod: :get,
formnovalidate: true, data: {turbo_stream: true}} %>
<%= image_button_tag t('.new_quantity'), 'plus-outline',
formaction: new_measurement_path, **common_options -%>
<%= image_button_tag t('.new_children'), 'plus-multiple-outline',
formaction: new_measurement_path(:children), **common_options -%>
<%= image_button_tag t('.new_subtree'), 'plus-multiple-outline',
formaction: new_measurement_path(:subtree), **common_options -%>
</div>
<% end %>
</div>