diff --git a/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb b/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb index 663b401..c8ff0e2 100644 --- a/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb +++ b/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb @@ -21,15 +21,15 @@ def field_set_and_list_wrapping(*args, &block) #:nodoc: # Ruby 1.9: String#to_s behavior changed, need to make an explicit join. contents = contents.join if contents.respond_to?(:join) - legend = field_set_legend(html_options) - fieldset = template.content_tag(:fieldset, - legend.html_safe << contents.html_safe, + legend = field_set_legend(html_options).html_safe + legend << contents.html_safe if contents.present? + + template.content_tag( + :fieldset, + legend, html_options.except(:builder, :parent, :name) ) - - fieldset end - end end end