1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

Options :nothing and :text => nil should be handled by
ActionController::Rendering instead.
This commit is contained in:
Carlos Antonio da Silva 2012-01-15 15:37:27 -02:00
parent 6244d16eaf
commit 53596d0913
2 changed files with 4 additions and 3 deletions

View file

@ -165,9 +165,6 @@ module AbstractController
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 file

@ -44,6 +44,10 @@ module ActionController
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