Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit c782641002b7df1ecd693a6c5c439f3a4c036351 1 parent 34221cd
@aditya-kapoor aditya-kapoor authored
View
12 actionview/lib/action_view/helpers/debug_helper.rb
@@ -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
View
2  actionview/test/template/debug_helper_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.