Show error messages and highlight for bulk editing

The validation message is on "tax_category", so labels and error messages can use that to show the error state.
But the select field has to be "tax_category_id" to work.
This commit is contained in:
David Cook
2024-05-16 11:12:13 +10:00
parent 412c110c65
commit 3e1e7d3a10
2 changed files with 2 additions and 1 deletions

View File

@@ -56,6 +56,7 @@
include_blank: t('.none_tax_category'),
aria_label: t('.tax_category_field_name'),
placeholder_value: t('.search_for_tax_categories')))
= error_message_on variant, :tax_category
%td.align-left
-# empty
%td.align-right

View File

@@ -65,7 +65,7 @@
= f.number_field field, value: value, class: 'fullwidth', step: 0.01
.field
= f.label :tax_category_id, t(:tax_category)
= f.label :tax_category, t(:tax_category), for: :tax_category_id
= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t(:none) }, { class: 'select2 fullwidth' })
.field