Skip to content

Commit

Permalink
Processing haml in block for buttons helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
suranyami committed Mar 5, 2012
1 parent 8997b9b commit 2f9e3ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/formtastic-bootstrap/helpers/buttons_helper.rb
Expand Up @@ -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") }
Expand Down

0 comments on commit 2f9e3ee

Please sign in to comment.