diff --git a/lib/bootstrap_form/form_builder.rb b/lib/bootstrap_form/form_builder.rb index ceca432a1..9068e6015 100644 --- a/lib/bootstrap_form/form_builder.rb +++ b/lib/bootstrap_form/form_builder.rb @@ -254,20 +254,20 @@ def form_group(*args, &block) label = generate_label(options[:id], name, options[:label], options[:label_col], options[:layout]) if options[:label] control = prepend_and_append_input(name, options, &block).to_s + help = options[:help] + help_text = generate_help(name, help).to_s + if get_group_layout(options[:layout]) == :horizontal control_class = options[:control_col] || control_col unless options[:label] control_offset = offset_col(options[:label_col] || @label_col) control_class = "#{control_class} #{control_offset}" end - control = content_tag(:div, control, class: control_class) + control = content_tag(:div, control + help_text, class: control_class) + concat(label).concat(control) + else + concat(label).concat(control).concat(help_text) end - - help = options[:help] - - help_text = generate_help(name, help).to_s - - concat(label).concat(control).concat(help_text) end end diff --git a/test/bootstrap_form_group_test.rb b/test/bootstrap_form_group_test.rb index 44dfbb5c8..2d9fc0dfd 100644 --- a/test/bootstrap_form_group_test.rb +++ b/test/bootstrap_form_group_test.rb @@ -189,8 +189,8 @@ class BootstrapFormGroupTest < ActionView::TestCase