From 2f9e3ee50b966104764a896e8403cfcb2f82e731 Mon Sep 17 00:00:00 2001 From: David Parry Date: Mon, 5 Mar 2012 17:51:54 +1100 Subject: [PATCH] Processing haml in block for buttons helper. --- lib/formtastic-bootstrap/helpers/buttons_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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") }