Sha256: 41ae35c0e7e7e1065fc0fb047179d6d409c08b8fc72a342ef565dcd6ec8f0f11

Contents?: true

Size: 1.16 KB

Versions: 89

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module ActionView
  module CompiledTemplates #:nodoc:
    # holds compiled template code
  end

  # = Action View Context
  #
  # Action View contexts are supplied to Action Controller to render a template.
  # The default Action View context is ActionView::Base.
  #
  # In order to work with ActionController, a Context must just include this module.
  # The initialization of the variables used by the context (@output_buffer, @view_flow,
  # and @virtual_path) is responsibility of the object that includes this module
  # (although you can call _prepare_context defined below).
  module Context
    include CompiledTemplates
    attr_accessor :output_buffer, :view_flow

    # Prepares the context by setting the appropriate instance variables.
    def _prepare_context
      @view_flow     = OutputFlow.new
      @output_buffer = nil
      @virtual_path  = nil
    end

    # Encapsulates the interaction with the view flow so it
    # returns the correct buffer on +yield+. This is usually
    # overwritten by helpers to add more behavior.
    def _layout_for(name = nil)
      name ||= :layout
      view_flow.get(name).html_safe
    end
  end
end

Version data entries

89 entries across 89 versions & 4 rubygems

Version Path
jets-1.8.11 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.10 vendor/rails/actionview/lib/action_view/context.rb
actionview-5.2.3 lib/action_view/context.rb
actionview-5.2.3.rc1 lib/action_view/context.rb
actionview-5.2.2.1 lib/action_view/context.rb
jets-1.8.9 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.8 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.7 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.6 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.5 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.4 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.3 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.2 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.1 vendor/rails/actionview/lib/action_view/context.rb
jets-1.8.0 vendor/rails/actionview/lib/action_view/context.rb
jets-1.7.2 vendor/rails/actionview/lib/action_view/context.rb
jets-1.7.1 vendor/rails/actionview/lib/action_view/context.rb
jets-1.7.0 vendor/rails/actionview/lib/action_view/context.rb
jets-1.6.9 vendor/rails/actionview/lib/action_view/context.rb
jets-1.6.8 vendor/rails/actionview/lib/action_view/context.rb