diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-26 14:04:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-26 14:04:04 -0700 |
commit | 2ceb16e539d13bb0f130dddd630776ea13ee9597 (patch) | |
tree | 41d2eac5ac2307e1a316042f40856515d5994e07 /actionpack/lib/abstract_controller | |
parent | fa09bf44db5592d003a59729cf3089b8630e8de6 (diff) | |
download | rails-2ceb16e539d13bb0f130dddd630776ea13ee9597.tar.gz rails-2ceb16e539d13bb0f130dddd630776ea13ee9597.tar.bz2 rails-2ceb16e539d13bb0f130dddd630776ea13ee9597.zip |
Pull `plain` content type handling up to `render`
`render` is the only possible source for the `plain` option. Pulling
the conditional up to the `render` method removes far away conditionals
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 854b07d707..a52aa8e874 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -23,7 +23,8 @@ module AbstractController def render(*args, &block) options = _normalize_render(*args, &block) self.response_body = render_to_body(options) - _process_format(rendered_format, options[:plain]) if rendered_format + _process_format(rendered_format) if rendered_format + self.content_type = Mime::TEXT if options[:plain] self.response_body end @@ -99,7 +100,7 @@ module AbstractController # Process the rendered format. # :api: private - def _process_format(format, plain = false) + def _process_format(format) end # Normalize args and options. |