module AbstractController::Rendering

def _normalize_args(action = nil, options = {}) # :doc:

:doc:
render :file => "foo/bar".
render :action => "foo" and render "foo/bar" to
Normalize args by converting render "foo" to
def _normalize_args(action = nil, options = {}) # :doc:
  if action.respond_to?(:permitted?)
    if action.permitted?
      action
    else
      raise ArgumentError, "render parameters are not permitted"
    end
  elsif action.is_a?(Hash)
    action
  else
    options
  end
end

def _normalize_options(options) # :doc:

:doc:
Normalize options.
def _normalize_options(options) # :doc:
  options
end

def _normalize_render(*args, &block) # :nodoc:

:nodoc:
Normalize args and options.
def _normalize_render(*args, &block) # :nodoc:
  options = _normalize_args(*args, &block)
  _process_variant(options)
  _normalize_options(options)
  options
end

def _process_format(format) # :nodoc:

:nodoc:
Process the rendered format.
def _process_format(format) # :nodoc:
end

def _process_options(options) # :doc:

:doc:
Process extra options.
def _process_options(options) # :doc:
  options
end

def _process_variant(options)

def _process_variant(options)
end

def _protected_ivars

def _protected_ivars
  DEFAULT_PROTECTED_INSTANCE_VARIABLES
end

def _set_html_content_type # :nodoc:

:nodoc:
def _set_html_content_type # :nodoc:
end

def _set_rendered_content_type(format) # :nodoc:

:nodoc:
def _set_rendered_content_type(format) # :nodoc:
end

def _set_vary_header # :nodoc:

:nodoc:
def _set_vary_header # :nodoc:
end

def render(*args, &block)

Supported options depend on the underlying +render_to_body+ implementation.

sticks the result in self.response_body.
Normalizes arguments and options, and then delegates to render_to_body and
def render(*args, &block)
  options = _normalize_render(*args, &block)
  rendered_body = render_to_body(options)
  if options[:html]
    _set_html_content_type
  else
    _set_rendered_content_type rendered_format
  end
  _set_vary_header
  self.response_body = rendered_body
end

def render_to_body(options = {})

Performs the actual template rendering.
def render_to_body(options = {})
end

def render_to_string(*args, &block)

needs to be overridden in order to still return a string.
extends it to be anything that responds to the method each), this method
If a component extends the semantics of +response_body+ (as ActionController

instead of setting +self.response_body+.
Similar to #render, but only returns the rendered template as a string,
def render_to_string(*args, &block)
  options = _normalize_render(*args, &block)
  render_to_body(options)
end

def rendered_format

Returns +Content-Type+ of rendered content.
def rendered_format
  Mime[:text]
end

def view_assigns

You can overwrite this configuration per controller.
This method should return a hash with assigns.
def view_assigns
  variables = instance_variables - _protected_ivars
  variables.each_with_object({}) do |name, hash|
    hash[name.slice(1, name.length)] = instance_variable_get(name)
  end
end