Module: EffectiveFormBuilderHelper

Defined in:
app/helpers/effective_form_builder_helper.rb

Instance Method Summary collapse

Instance Method Details

#effective_form_with(**options, &block) ⇒ Object



2
3
4
5
6
7
8
# File 'app/helpers/effective_form_builder_helper.rb', line 2

def effective_form_with(**options, &block)
  options[:class] = [options[:class], 'needs-validation', ('form-inline' if options[:layout] == :inline)].compact.join(' ')

  without_error_proc do
    form_with(**options.merge(builder: Effective::FormBuilder, html: { novalidate: true, onsubmit: 'return EffectiveBootstrap.validate(this);' }), &block)
  end
end