Module: Ilex::ArbreExt::Element

Defined in:
lib/ilex/arbre_ext/element.rb,
lib/ilex/arbre_ext/element/builder_methods.rb

Defined Under Namespace

Modules: BuilderMethods

Instance Method Summary collapse

Instance Method Details

#helper_capture(name, *args, &block) ⇒ Object

The helper might have a block that builds Arbre elements which will be rendered (#to_s) inside ActionView::Base#capture. We do not want such elements added to self, so we push a dummy current_arbre_element.



20
21
22
23
24
# File 'lib/ilex/arbre_ext/element.rb', line 20

def helper_capture(name, *args, &block)
  s = ""
  within(Element.new) { s = helpers.send(name, *args, &block) }
  s.is_a?(Element) ? s.to_s : s
end