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
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-4.2.8/lib/action_view/context.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-5.0.2/lib/action_view/context.rb
actionview-5.0.2 lib/action_view/context.rb
actionview-5.0.2.rc1 lib/action_view/context.rb
actionview-4.2.8 lib/action_view/context.rb
actionview-4.2.8.rc1 lib/action_view/context.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-5.0.1/lib/action_view/context.rb
abaci-0.3.0 vendor/bundle/gems/actionview-5.0.0/lib/action_view/context.rb
actionview-5.0.1 lib/action_view/context.rb
actionview-5.0.1.rc2 lib/action_view/context.rb
actionview-5.0.1.rc1 lib/action_view/context.rb
actionview-5.0.0.1 lib/action_view/context.rb
actionview-4.2.7.1 lib/action_view/context.rb
actionview-4.2.7 lib/action_view/context.rb