lib/volt/page/bindings/template_binding.rb
# The context for templates can be either a controller, or the original context.
The context for templates can be either a controller, or the original context.
The context for templates can be either a controller or the original context .
def render_template(full_path, controller_path)
    args = @arguments ? [@arguments] : []
    @controller = nil
    @controller = @grouped_controller.get if @grouped_controller
    unless @controller
      controller_class, action = get_controller(controller_path)
      if controller_class
        @controller = controller_class.new(*args)
      else
        @controller = ModelController.new(*args)
      end
      @controller.send(action) if @controller.respond_to?(action)
      @grouped_controller.set(@controller) if @grouped_controller
    end
    @current_template = TemplateRenderer.new(@page, @target, @controller, @binding_name, full_path)
    call_ready
  end
def render_template ( full_path , controller_path ) args = @arguments ? [ @arguments ] : [ ] @controller = nil @controller = @grouped_controller . get if @grouped_controller unless @controller controller_class , action = get_controller ( controller_path ) if controller_class @controller = controller_class . new ( * args ) else @controller = ModelController . new ( * args ) end @controller . send ( action ) if @controller . respond_to? ( action ) @grouped_controller . set ( @controller ) if @grouped_controller end @current_template = TemplateRenderer . new ( @page , @target , @controller , @binding_name , full_path ) call_ready end
The context for templates can be either a controller, or the original context.
The context for templates can be either a controller or the original context .
# Fetch grouped controllers if we're grouping # Otherwise, make a new controller # Setup the controller # Trigger the action # Track the grouped controller
full_path
controller_path