From 182e74f343ea31723689ad452045bd4558c5f5ce Mon Sep 17 00:00:00 2001 From: Mikk Romulus Date: Tue, 5 Dec 2023 13:14:25 +0200 Subject: [PATCH] fix: numbered_by form error Add hidden field with current value to prevent validation errors --- app/views/virtual_machines/_deployment_section.html.haml | 1 + config/locales/en.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/views/virtual_machines/_deployment_section.html.haml b/app/views/virtual_machines/_deployment_section.html.haml index 2b01fd56..170088a8 100644 --- a/app/views/virtual_machines/_deployment_section.html.haml +++ b/app/views/virtual_machines/_deployment_section.html.haml @@ -1,3 +1,4 @@ .grid.gap-6.grid-cols-2 + = f.hidden_field :numbered_by, value: @virtual_machine.numbered_by.to_gid = f.input :numbered_by, NumberingOptions.result_for(@virtual_machine, hash: { as: :select,input_html: { data: { controller: 'select' } }, selected: @virtual_machine.numbered_by&.to_gid }) = f.input :custom_instance_count \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 86f2f5e2..c53e88b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,6 +13,8 @@ en: attributes: name: invalid: is invalid (must not contain _) + numbered_by: + incoherent_numbering: would result in numbering incoherence address: attributes: offset: