aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/rendering.rb
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-08-14 21:21:22 +0200
committerŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2013-08-25 11:40:11 +0200
commitf6039df572cf2d06a6e4225112a902da4ae1bf4f (patch)
tree4fb341752f79231329e476ecfe8d4f143ecbe987 /actionpack/lib/action_controller/metal/rendering.rb
parente10a25310f0fd7fb210b31124d6ea262a90b4717 (diff)
downloadrails-f6039df572cf2d06a6e4225112a902da4ae1bf4f.tar.gz
rails-f6039df572cf2d06a6e4225112a902da4ae1bf4f.tar.bz2
rails-f6039df572cf2d06a6e4225112a902da4ae1bf4f.zip
Simplify if statements
Diffstat (limited to 'actionpack/lib/action_controller/metal/rendering.rb')
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index d0095caa75..c4b7b4f5ee 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -11,12 +11,10 @@ module ActionController
def render(*args, &block)
super(*args, &block)
opts = args.first
- if (opts.keys & [:text, :nothing]).present?
- self.response_body = if opts.has_key?(:text) && opts[:text].present?
- opts[:text]
- elsif opts.has_key?(:nothing) && opts[:nothing]
- " "
- end
+ if opts.has_key?(:text) && opts[:text].present?
+ self.response_body = opts[:text]
+ elsif opts.has_key?(:nothing) && opts[:nothing]
+ self.response_body = " "
else
raise UnsupportedOperationError
end