diff options
Diffstat (limited to 'actionview/lib/action_view/helpers/debug_helper.rb')
-rw-r--r-- | actionview/lib/action_view/helpers/debug_helper.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actionview/lib/action_view/helpers/debug_helper.rb b/actionview/lib/action_view/helpers/debug_helper.rb index e9dccbad1c..88ceba414b 100644 --- a/actionview/lib/action_view/helpers/debug_helper.rb +++ b/actionview/lib/action_view/helpers/debug_helper.rb @@ -1,10 +1,11 @@ +# frozen_string_literal: true + module ActionView # = Action View Debug Helper # # Provides a set of methods for making it easier to debug Rails objects. - module Helpers + module Helpers #:nodoc: module DebugHelper - include TagHelper # Returns a YAML representation of +object+ wrapped with <pre> and </pre>. @@ -23,12 +24,12 @@ module ActionView # created_at: # </pre> def debug(object) - Marshal::dump(object) + Marshal.dump(object) object = ERB::Util.html_escape(object.to_yaml) - content_tag(:pre, object, :class => "debug_dump") + content_tag(:pre, object, class: "debug_dump") rescue # errors from Marshal or YAML # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback - content_tag(:code, object.inspect, :class => "debug_dump") + content_tag(:code, object.inspect, class: "debug_dump") end end end |