aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-19 16:43:47 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-19 16:43:47 -0300
commitd4ca0a44c7564f939bc3df2f770083d709c13e95 (patch)
tree504d290d70a8b955939fb90ef1ff5ff2d6c3be56
parent70de7dda8c09c1e02e0281879ef6fb8f372ada5e (diff)
parentc782641002b7df1ecd693a6c5c439f3a4c036351 (diff)
downloadrails-d4ca0a44c7564f939bc3df2f770083d709c13e95.tar.gz
rails-d4ca0a44c7564f939bc3df2f770083d709c13e95.tar.bz2
rails-d4ca0a44c7564f939bc3df2f770083d709c13e95.zip
Merge pull request #15450 from aditya-kapoor/remove-nbsp-debug
remove unnecessary gsub for space in ActionView::Helpers#debug
-rw-r--r--actionview/lib/action_view/helpers/debug_helper.rb12
-rw-r--r--actionview/test/template/debug_helper_test.rb2
2 files changed, 7 insertions, 7 deletions
diff --git a/actionview/lib/action_view/helpers/debug_helper.rb b/actionview/lib/action_view/helpers/debug_helper.rb
index 16cddec339..ba47eee9ba 100644
--- a/actionview/lib/action_view/helpers/debug_helper.rb
+++ b/actionview/lib/action_view/helpers/debug_helper.rb
@@ -16,15 +16,15 @@ module ActionView
# # =>
# <pre class='debug_dump'>--- !ruby/object:User
# attributes:
- # &nbsp; updated_at:
- # &nbsp; username: testing
- # &nbsp; age: 42
- # &nbsp; password: xyz
- # &nbsp; created_at:
+ # updated_at:
+ # username: testing
+ # age: 42
+ # password: xyz
+ # created_at:
# </pre>
def debug(object)
Marshal::dump(object)
- object = ERB::Util.html_escape(object.to_yaml).gsub(" ", "&nbsp; ").html_safe
+ object = ERB::Util.html_escape(object.to_yaml)
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
diff --git a/actionview/test/template/debug_helper_test.rb b/actionview/test/template/debug_helper_test.rb
index 42d06bd9ff..5609694cd5 100644
--- a/actionview/test/template/debug_helper_test.rb
+++ b/actionview/test/template/debug_helper_test.rb
@@ -3,6 +3,6 @@ require 'active_record_unit'
class DebugHelperTest < ActionView::TestCase
def test_debug
company = Company.new(name: "firebase")
- assert_match "&nbsp; name: firebase", debug(company)
+ assert_match "name: firebase", debug(company)
end
end