Module: MNE::TwitterBootstrapFormBuilder::Helper

Defined in:
lib/twitter-bootstrap-form-builder/helper.rb

Instance Method Summary collapse

Instance Method Details

#form_for(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/twitter-bootstrap-form-builder/helper.rb', line 5

def form_for (*args)
  args << {} unless args.last.is_a? Hash

  args.last[:builder] ||= MNE::TwitterBootstrapFormBuilder::FormBuilder
  args.last[:html] ||= {}
  args.last[:html][:class] ||= ""

  if !args.last[:html][:class].match(/form-(horizontal|vertical)/)
    args.last[:html][:class] = ["form-horizontal", args.last[:html][:class]].join(" ")
  end

  super
end