Use Optional Form Components
mainTo prevent components like :hint or :placeholder from generating automatically, use the optional method in your wrapper configuration. An optional component will only be rendered if it is explicitly enabled in the view (e.g., f.input :name, hint: true).
You can also use unless_blank: true on a wrapper to ensure it only renders when the content is present.
config.wrappers placeholder: false do |b|
b.use :placeholder
b.use :label_input
b.wrapper tag: :div, class: 'separator' do |component|
component.optional :hint, wrap_with: { tag: :span, class: :hint }
component.use :error, wrap_with: { tag: :span, class: :error }
end
end