Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@carlosantoniodasilva carlosantoniodasilva authored
View
3  actionpack/lib/abstract_controller/rendering.rb
@@ -165,9 +165,6 @@ def _normalize_options(options)
options[:prefixes] ||= _prefixes
end
- options[:text] = nil if options.delete(:nothing) == true
- options[:text] = " " if options.key?(:text) && options[:text].nil?
-
options[:template] ||= (options[:action] || action_name).to_s
options
end
View
4 actionpack/lib/action_controller/metal/rendering.rb
@@ -44,6 +44,10 @@ def _normalize_options(options) #:nodoc:
options[:text] = options[:text].to_text
end
+ if options.delete(:nothing) || (options.key?(:text) && options[:text].nil?)
+ options[:text] = " "
+ end
+
if options[:status]
options[:status] = Rack::Utils.status_code(options[:status])
end
Please sign in to comment.
Something went wrong with that request. Please try again.