Minor refactor to support_form_with implementation

Realizing that, with the keyword argument spread syntax, I don't need
to do merging, I can just. spread at the right place!

My rationale for the ordering here is: if the caller theoretically tried
to override the builder (even though I don't see why), I think we would
want to respect that. Whereas the `class` argument should be overridden
because we're safely *merging* our `.support-form` class into it.
This commit is contained in:
Emi Matchu 2024-12-01 09:45:26 -08:00
parent aeb00f73cf
commit b6e6f27fdf

View file

@ -50,10 +50,11 @@ module SupportFormHelper
end
def support_form_with(**options, &block)
options.merge!(
form_with(
builder: SupportFormBuilder,
**options,
class: ["support-form", options[:class]],
&block
)
form_with(**options, &block)
end
end