Sha256: dc0645e44d261a9d957a2c3c4d2f5d89fae7130f8ce43e469ac856082413bf4c

Contents?: true

Size: 1.17 KB

Versions: 161

Compression:

Stored size: 1.17 KB

Contents

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.
    # :api: plugin
    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.
    # :api: plugin
    def _layout_for(name=nil)
      name ||= :layout
      view_flow.get(name).html_safe
    end
  end
end

Version data entries

161 entries across 156 versions & 13 rubygems

Version Path
actionview-4.2.11.3 lib/action_view/context.rb
actionview-4.2.11.2 lib/action_view/context.rb
actionview-5.0.7.2 lib/action_view/context.rb
actionview-4.2.11.1 lib/action_view/context.rb
actionview-5.0.7.1 lib/action_view/context.rb
actionview-4.2.11 lib/action_view/context.rb
actionview-5.0.7 lib/action_view/context.rb
actionview-4.2.10 lib/action_view/context.rb
actionview-4.2.10.rc1 lib/action_view/context.rb
actionview-5.0.6 lib/action_view/context.rb
actionview-5.0.6.rc1 lib/action_view/context.rb
actionview-5.0.5 lib/action_view/context.rb
actionview-5.0.5.rc2 lib/action_view/context.rb
actionview-5.0.5.rc1 lib/action_view/context.rb
actionview-4.2.9 lib/action_view/context.rb
actionview-4.2.9.rc2 lib/action_view/context.rb
actionview-5.0.4 lib/action_view/context.rb
actionview-5.0.4.rc1 lib/action_view/context.rb
actionview-4.2.9.rc1 lib/action_view/context.rb
actionview-5.0.3 lib/action_view/context.rb