Sha256: feede92ef881e09ad63e3f88d7ace2d1533951c47aee49fba3f802cf260486ba
Contents?: true
Size: 645 Bytes
Versions: 6
Compression:
Stored size: 645 Bytes
Contents
module SproutCore module Helpers module CaptureHelper # Captures the resulting value of the block and returns it def capture(*args, &block) self.renderer ? self.renderer.capture(args, &block) : block.call(*args).to_s end # executes the passed block, placing the resulting content into a variable called # @content_for_area_name. You can insert this content later by including this # variable or by calling yield(:area_name) # def content_for(name, &block) eval "@content_for_#{name} = (@content_for_#{name} || '') + (capture(&block) || '')" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems