Sha256: 1a9d7f0d941858f15a5d61fb3488c9209486e44553fea2631bbbaed6d35f8317
Contents?: true
Size: 769 Bytes
Versions: 14
Compression:
Stored size: 769 Bytes
Contents
# Proxy component for content_for to prevent it from inserting the block's # value into its location. class ContentForProxy < Arbre::HTML::Tag builder_method :content_for def build(key, content = nil, &block) @value = helpers.content_for(key, content, &block) end def to_s @value end end # Patch to #capture to support Arbre::Element module ActionView module Helpers module CaptureHelper def capture(*args) value = nil buffer = with_output_buffer { value = yield(*args) } value = value.to_s if value.is_a?(Arbre::Element) || value.is_a?(Arbre::ElementCollection) if string = buffer.presence || value and string.is_a?(String) ERB::Util.html_escape string end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems