diff options
author | Benjamin Fleischer <github@benjaminfleischer.com> | 2016-01-03 22:13:59 -0600 |
---|---|---|
committer | Benjamin Fleischer <github@benjaminfleischer.com> | 2016-01-03 22:51:45 -0600 |
commit | f27360af04f11506d7081b2bd46c9ea0413a910c (patch) | |
tree | 8de9e9dba60a0f48df1d3e7ef8489886d26124d4 /actionpack/lib/action_controller | |
parent | 41ed6e90b13e8f70270531870f29454b8fe329e1 (diff) | |
download | rails-f27360af04f11506d7081b2bd46c9ea0413a910c.tar.gz rails-f27360af04f11506d7081b2bd46c9ea0413a910c.tar.bz2 rails-f27360af04f11506d7081b2bd46c9ea0413a910c.zip |
Add ActionController:Renderers test
To complement actionpack/test/controller/metal/renderers_test.rb
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/renderers.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 <tt>Responder#api_behavior</tt> 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 <tt>AbstractController::Renderering</tt> + # which sets the return value as the +response_body+. + # + # If no renderer is found, +super+ returns control to + # <tt>ActionView::Rendering.render_to_body</tt>, 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 <tt>ActionController::Base</tt> + # and <tt>ActionController::API</tt> to include all + # renderers by default. module All extend ActiveSupport::Concern include Renderers |