diff --git a/lib/formtastic-bootstrap/helpers/buttons_helper.rb b/lib/formtastic-bootstrap/helpers/buttons_helper.rb index 316ccce8..5f8138d6 100644 --- a/lib/formtastic-bootstrap/helpers/buttons_helper.rb +++ b/lib/formtastic-bootstrap/helpers/buttons_helper.rb @@ -15,8 +15,12 @@ def buttons(*args, &block) if block_given? template.content_tag(:div, html_options) do - yield - end + contents = if template.respond_to?(:is_haml?) && template.is_haml? + template.capture_haml(&block) + else + template.capture(&block) + end + end else args = [:commit] if args.empty? contents = args.map { |button_name| send(:"#{button_name}_button") }