module AbstractController::Rendering
def _normalize_args(action = nil, options = {}) # :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:
Normalize options.
def _normalize_options(options) # :doc: options end
def _normalize_render(*args, &block) # :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:
Process the rendered format.
def _process_format(format) # :nodoc: end
def _process_options(options) # :doc:
Process extra options.
def _process_options(options) # :doc: options end
def _process_variant(options)
def _process_variant(options) end
def _protected_ivars # :nodoc:
def _protected_ivars # :nodoc: DEFAULT_PROTECTED_INSTANCE_VARIABLES end
def _set_html_content_type # :nodoc:
def _set_html_content_type # :nodoc: end
def _set_rendered_content_type(format) # :nodoc:
def _set_rendered_content_type(format) # :nodoc: end
def render(*args, &block)
Normalizes arguments, options and then delegates 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 self.response_body = rendered_body end
def render_to_body(options = {})
def render_to_body(options = {}) end
def render_to_string(*args, &block)
responds to the method each), this method needs to be
(as ActionController extends it to be anything that
If a component extends the semantics of +response_body+
to always return a string.
set the +response_body+ and it should be guaranteed
It is similar to render, except that it does not
Raw rendering of a template to a string.
def render_to_string(*args, &block) options = _normalize_render(*args, &block) render_to_body(options) end
def rendered_format
def rendered_format Mime[:text] end
def view_assigns
This method should return a hash with assigns.
def view_assigns protected_vars = _protected_ivars variables = instance_variables variables.reject! { |s| protected_vars.include? s } variables.each_with_object({}) { |name, hash| hash[name.slice(1, name.length)] = instance_variable_get(name) } end