Module: BootstrapBuilder::Helper

Defined in:
lib/bootstrap_builder/helper.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_form_for(record_or_name_or_array, *args, &proc) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/bootstrap_builder/helper.rb', line 3

def bootstrap_form_for(record_or_name_or_array, *args, &proc)
  options = args.extract_options!
  options.merge!(:builder => BootstrapBuilder::Builder)
  options[:html] ||= { }
  options[:html][:class] ||= ''
  if !(options[:html][:class] =~ /form-/)
    options[:html][:class] += ' ' + BootstrapBuilder.config.default_form_class
  end
  form_for(record_or_name_or_array, *(args << options), &proc)
end