lib/haml/helpers/action_view_mods.rb in haml-3.2.0.alpha.8 vs lib/haml/helpers/action_view_mods.rb in haml-3.2.0.alpha.10

- old
+ new

@@ -86,10 +86,11 @@ end else module CaptureHelper def capture_with_haml(*args, &block) if Haml::Helpers.block_is_haml?(block) + _hamlout = eval('_hamlout', block.binding) # Necessary since capture_haml checks _hamlout value = nil buffer = capture_haml(*args) { value = yield(*args) } str = if !buffer.empty? buffer @@ -127,21 +128,22 @@ alias_method :content_tag_without_haml, :content_tag alias_method :content_tag, :content_tag_with_haml end class InstanceTag - # Includes TagHelper + # Already includes TagHelper + include Haml::Helpers def haml_buffer @template_object.send :haml_buffer end def is_haml? @template_object.send :is_haml? end - def content_tag(*args) - html_tag = content_tag_with_haml(*args) + def content_tag(*args, &block) + html_tag = content_tag_with_haml(*args, &block) return html_tag unless respond_to?(:error_wrapping) return error_wrapping(html_tag) if method(:error_wrapping).arity == 1 return html_tag unless object.respond_to?(:errors) && object.errors.respond_to?(:on) return error_wrapping(html_tag, object.errors.on(@method_name)) end