Module: BootstrapForm::FormGroup

Extended by:
ActiveSupport::Concern
Included in:
FormBuilder
Defined in:
lib/bootstrap_form/form_group.rb

Instance Method Summary collapse

Instance Method Details

#form_group(*args, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bootstrap_form/form_group.rb', line 7

def form_group(*args, &block)
  options = args.extract_options!
  name = args.first

  options[:class] = form_group_classes(options)

  tag.div(**options.except(:append, :id, :label, :help, :icon,
                           :input_group_class, :label_col, :control_col,
                           :add_control_col_class, :layout, :prepend, :floating)) do
    form_group_content(
      generate_label(options[:id], name, options[:label], options[:label_col], options[:layout]),
      generate_help(name, options[:help]), options, &block
    )
  end
end