Skip to content
This repository
Browse code

Refactor render nothing/text => nil logic, and move to right place

Options :nothing and :text => nil should be handled by
ActionController::Rendering instead.
  • Loading branch information...
commit 53596d091390bda7fb9b78ad838273a9e63fbde1 1 parent 6244d16
Carlos Antonio da Silva carlosantoniodasilva authored
3  actionpack/lib/abstract_controller/rendering.rb
@@ -165,9 +165,6 @@ def _normalize_options(options)
165 165 options[:prefixes] ||= _prefixes
166 166 end
167 167
168   - options[:text] = nil if options.delete(:nothing) == true
169   - options[:text] = " " if options.key?(:text) && options[:text].nil?
170   -
171 168 options[:template] ||= (options[:action] || action_name).to_s
172 169 options
173 170 end
4 actionpack/lib/action_controller/metal/rendering.rb
@@ -44,6 +44,10 @@ def _normalize_options(options) #:nodoc:
44 44 options[:text] = options[:text].to_text
45 45 end
46 46
  47 + if options.delete(:nothing) || (options.key?(:text) && options[:text].nil?)
  48 + options[:text] = " "
  49 + end
  50 +
47 51 if options[:status]
48 52 options[:status] = Rack::Utils.status_code(options[:status])
49 53 end

0 comments on commit 53596d0

Please sign in to comment.
Something went wrong with that request. Please try again.