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/action_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/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 0a005085ba..a2d671486d 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -56,14 +56,10 @@ module ActionController nil end - def _process_format(format, plain = false) + def _process_format(format) super - if plain - self.content_type = Mime::TEXT - else - self.content_type ||= format.to_s - end + self.content_type ||= format.to_s end # Normalize arguments by catching blocks and setting them on :update. |