Sha256: c2cb394c4e7c4471e263647424ebe64290e3252c4d87dbd7c6a1ecc83c513917
Contents?: true
Size: 830 Bytes
Versions: 20
Compression:
Stored size: 830 Bytes
Contents
# The yield binding renders the content of a tag which passes in require 'volt/page/bindings/base_binding' require 'volt/page/template_renderer' module Volt class YieldBinding < BaseBinding def initialize(page, target, context, binding_name) super(page, target, context, binding_name) # Get the path to the template to yield full_path = @context.attrs.content_template_path # Grab the controller for the content controller = @context.attrs.content_controller @current_template = TemplateRenderer.new(@page, @target, controller, @binding_name, full_path) end def remove if @current_template # Remove the template if one has been rendered, when the template binding is # removed. @current_template.remove end super end end end
Version data entries
20 entries across 20 versions & 1 rubygems