Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use gsub intead of tr when the to_str is longer than the from_str #9573

Merged
merged 1 commit into from

3 participants

@guilleiguaran guilleiguaran merged commit 9e43ce5 into rails:master
@rafaelfranca
Owner

We will need tests to ensure this will not occur anymore

@guilleiguaran

@rafaelfranca :+1: sure, I merged the first one after of verify that all AP tests were passing

@robertomiranda

@rafaelfranca I'll add test for that

@robertomiranda robertomiranda deleted the robertomiranda:useless_gsub branch
@robertomiranda robertomiranda referenced this pull request
Merged

Add DebugHelperTest #9574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.