Module | ActionView::Helpers::CaptureHelper
In: | lib/haml/helpers/action_view_mods.rb lib/haml/helpers/xss_mods.rb

### Methods

capture capture capture_erb_with_buffer capture_erb_with_buffer_with_haml capture_with_haml capture_with_haml capture_without_haml with_output_buffer with_output_buffer_with_haml_xss

### External Aliases

capture | -> | capture_without_haml
capture_erb_with_buffer | -> | capture_erb_with_buffer_without_haml
with_output_buffer | -> | with_output_buffer_without_haml_xss

### Public Instance methods

capture(*args, &block)

Alias for capture_with_haml

capture(*args, &block)

Alias for capture_with_haml

capture_erb_with_buffer(buffer, *args, &block)

Alias for capture_erb_with_buffer_with_haml

capture_erb_with_buffer_with_haml(buffer, *args, &block)

[Source]

        # File lib/haml/helpers/action_view_mods.rb, line 62
    62:         def capture_erb_with_buffer_with_haml(buffer, *args, &block)
    63:           if is_haml?
    64:             capture_haml(*args, &block)
    65:           else
    66:             capture_erb_with_buffer_without_haml(buffer, *args, &block)
    67:           end
    68:         end

capture_with_haml(*args, &block)

[Source]

        # File lib/haml/helpers/action_view_mods.rb, line 47
    47:         def capture_with_haml(*args, &block)
    48:           # Rails' #capture helper will just return the value of the block
    49:           # if it's not actually in the template context,
    50:           # as detected by the existance of an _erbout variable.
    51:           # We've got to do the same thing for compatibility.
    52:
    53:           if is_haml? && block_is_haml?(block)
    54:             capture_haml(*args, &block)
    55:           else
    56:             capture_without_haml(*args, &block)
    57:           end
    58:         end

capture_with_haml(*args, &block)

[Source]

        # File lib/haml/helpers/action_view_mods.rb, line 86
    86:         def capture_with_haml(*args, &block)
    87:           if Haml::Helpers.block_is_haml?(block)
    88:             str = capture_haml(*args, &block)
    89:             return ActionView::NonConcattingString.new(str) if defined?(ActionView::NonConcattingString)
    90:             return str
    91:           else
    92:             capture_without_haml(*args, &block)
    93:           end
    94:         end

capture_without_haml(*args, &block)

Alias for capture

with_output_buffer(*args, &block)

Alias for with_output_buffer_with_haml_xss

with_output_buffer_with_haml_xss(*args, &block)

[Source]

         # File lib/haml/helpers/xss_mods.rb, line 108
    108:       def with_output_buffer_with_haml_xss(*args, &block)
    109:         res = with_output_buffer_without_haml_xss(*args, &block)
    110:         case res
    111:         when Array; res.map {|s| Haml::Util.html_safe(s)}
    112:         when String; Haml::Util.html_safe(res)
    113:         else; res
    114:         end
    115:       end

[Validate]