From f27360af04f11506d7081b2bd46c9ea0413a910c Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Sun, 3 Jan 2016 22:13:59 -0600 Subject: Add ActionController:Renderers test To complement actionpack/test/controller/metal/renderers_test.rb --- actionpack/lib/action_controller/metal/renderers.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index 1f77f9ecaa..f171c4d172 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -11,6 +11,7 @@ module ActionController Renderers.remove(key) end + # See Responder#api_behavior class MissingRenderer < LoadError def initialize(format) super "No renderer defined for format: #{format}" @@ -67,6 +68,11 @@ module ActionController alias use_renderer use_renderers end + # Called by +render+ in AbstractController::Renderering + # which sets the return value as the +response_body+. + # + # If no renderer is found, +super+ returns control to + # ActionView::Rendering.render_to_body, if present. def render_to_body(options) _render_to_body_with_renderer(options) || super end @@ -137,6 +143,9 @@ module ActionController remove_method(method_name) if method_defined?(method_name) end + # Used in ActionController::Base + # and ActionController::API to include all + # renderers by default. module All extend ActiveSupport::Concern include Renderers -- cgit v1.2.3