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:
parent
6244d16eaf
commit
53596d0913
2 changed files with 4 additions and 3 deletions
|
@ -165,9 +165,6 @@ module AbstractController
|
||||||
options[:prefixes] ||= _prefixes
|
options[:prefixes] ||= _prefixes
|
||||||
end
|
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[:template] ||= (options[:action] || action_name).to_s
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,6 +44,10 @@ module ActionController
|
||||||
options[:text] = options[:text].to_text
|
options[:text] = options[:text].to_text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if options.delete(:nothing) || (options.key?(:text) && options[:text].nil?)
|
||||||
|
options[:text] = " "
|
||||||
|
end
|
||||||
|
|
||||||
if options[:status]
|
if options[:status]
|
||||||
options[:status] = Rack::Utils.status_code(options[:status])
|
options[:status] = Rack::Utils.status_code(options[:status])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue