Module: ActiveDryForm::FormHelper

Defined in:
lib/active_dry_form/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#active_dry_form_for(name, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/active_dry_form/form_helper.rb', line 6

def active_dry_form_for(name, options = {})
  options[:builder] = ActiveDryForm::Builder
  options[:html] ||= {}
  options[:html][:class] = "active-dry-form #{options[:html][:class]}"

  form_for(name, options) do |f|
    concat f.show_base_errors
    yield(f)
  end
end