Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9573 from robertomiranda/useless_gsub

Use gsub intead of tr when the to_str is longer than the from_str
  • Loading branch information...
commit 9e43ce5a2b099d8c92713e4f4fff902f0e6a474a 2 parents 6ea48eb + 8a189d0
@guilleiguaran guilleiguaran authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_view/helpers/debug_helper.rb
View
2  actionpack/lib/action_view/helpers/debug_helper.rb
@@ -28,7 +28,7 @@ module DebugHelper
# </pre>
def debug(object)
Marshal::dump(object)
- object = ERB::Util.html_escape(object.to_yaml).tr(" ", "&nbsp; ").html_safe
+ object = ERB::Util.html_escape(object.to_yaml).gsub(" ", "&nbsp; ").html_safe
content_tag(:pre, object, :class => "debug_dump")
rescue Exception # errors from Marshal or YAML
# Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
Please sign in to comment.
Something went wrong with that request. Please try again.