Action View Context

Action View contexts are supplied to Action Controller to render 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).

Methods
#
Included Modules
Attributes
[RW] output_buffer
[RW] view_flow
Instance Public methods
_layout_for(name=nil)

Encapsulates the interaction with the view flow so it returns the correct buffer on yield. This is usually overwriten by helpers to add more behavior. :api: plugin

    # File actionpack/lib/action_view/context.rb, line 31
31:     def _layout_for(name=nil)
32:       name ||= :layout
33:       view_flow.get(name).html_safe
34:     end
_prepare_context()

Prepares the context by setting the appropriate instance variables. :api: plugin

    # File actionpack/lib/action_view/context.rb, line 21
21:     def _prepare_context
22:       @view_flow     = OutputFlow.new
23:       @output_buffer = nil
24:       @virtual_path  = nil
25:     end