Permalink
Browse files

remove unnecessary substitution for space in ActionView::Helpers#debug

  • Loading branch information...
1 parent 34221cd commit c782641002b7df1ecd693a6c5c439f3a4c036351 @aditya-kapoor aditya-kapoor committed Jun 14, 2014
@@ -16,15 +16,15 @@ module DebugHelper
# # =>
# <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
@@ -3,6 +3,6 @@
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

0 comments on commit c782641

Please sign in to comment.