Module: SimpleBootstrapForm::ActionViewExtensions

Defined in:
lib/simple_bootstrap_form/action_view_extensions.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_form_for(record, options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/simple_bootstrap_form/action_view_extensions.rb', line 4

def bootstrap_form_for(record, options={}, &block)
  options[:builder] ||= SimpleBootstrapForm::FormBuilder
  options[:html] ||= {}
  options[:html][:class] = CssClassList.new options[:html][:class]
  options[:html][:class] << 'form-horizontal'
  options[:html][:role] ||= 'form'
  prevent_action_view_putting_a_div_around_all_fields_with_errors do
    form_for record, options, &block
  end
end