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

Methods

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)

[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

[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

[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:             capture_haml(*args, &block)
89:           else
90:             capture_without_haml(*args, &block)
91:           end
92:         end
capture_without_haml(*args, &block)

Alias for capture

with_output_buffer(*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]