Module: Cuba::Render
- Defined in:
- lib/content_for.rb
Instance Method Summary collapse
Instance Method Details
#content_for(key, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/content_for.rb', line 3 def content_for(key, &block) if block @_content_for ||= {} buf_was = @haml_buffer.buffer @haml_buffer.buffer = '' yield @_content_for[key] = @haml_buffer.buffer @haml_buffer.buffer = buf_was elsif @_content_for @_content_for[key] end end |