class ActionView::AbstractRenderer
:nodoc:
into a separate classes for partials and templates.
that new object is called in turn. This abstracts the setup and rendering
renderer object of the correct type is created, and the render method on
Whenever the render method is called on the base Renderer class, a new
StreamingTemplateRenderer - Used for streaming
TemplateRenderer - Used for rendering other types of templates
PartialRenderer - Used for rendering partials
renderers. These currently consist of
The base Renderer class uses its render method to delegate to the
render a specific type of object.
subclasses AbstractRenderer is used by the base Renderer class to
This class defines the interface for a renderer. Each class that
def extract_details(options)
def extract_details(options) @lookup_context.registered_details.each_with_object({}) do |key, details| value = options[key] details[key] = Array(value) if value end end
def initialize(lookup_context)
def initialize(lookup_context) @lookup_context = lookup_context end
def instrument(name, options={})
def instrument(name, options={}) ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield } end
def prepend_formats(formats)
def prepend_formats(formats) formats = Array(formats) return if formats.empty? || @lookup_context.html_fallback_for_js @lookup_context.formats = formats | @lookup_context.formats end
def render
def render raise NotImplementedError end