Skip to content

Commit 9239413

Browse files
chaimanntvdeyen
authored andcommitted
Assume switch field wants to include hidden by default
1 parent d9e726e commit 9239413

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

admin/app/lib/solidus_admin/form_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def hidden_field(method, **options)
3737
input(method, type: :hidden, autocomplete: "off", **options)
3838
end
3939

40-
def switch_field(method, label: nil, **options)
40+
def switch_field(method, label: nil, include_hidden: true, **options)
4141
label = @object.class.human_attribute_name(method) if label.nil?
4242
name = "#{@object_name}[#{method}]"
4343
error = @object.errors[method]
4444
checked = @object.public_send(method)
45-
render component("ui/forms/switch_field").new(label:, name:, error:, checked:, **options)
45+
render component("ui/forms/switch_field").new(label:, name:, error:, checked:, include_hidden:, **options)
4646
end
4747

4848
def submit(**options)

0 commit comments

Comments
 (0)