Module: VCFB::FormHelper

Defined in:
lib/vcfb/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#component_form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/vcfb/form_helper.rb', line 3

def component_form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block)
  options[:builder] ||= VCFB::FormBuilder
  if options[:builder].try(:form_component_defined?)
    render options[:builder].form_component_class.new(model: model, scope: scope, url: url, format: format, **options), &block
  else
    form_with(model: model, scope: scope, url: url, format: format, **options, &block)
  end
end