aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/debug_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/debug_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/debug_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb
index 9e92813a18..ef089c1bad 100644
--- a/actionpack/lib/action_view/helpers/debug_helper.rb
+++ b/actionpack/lib/action_view/helpers/debug_helper.rb
@@ -3,6 +3,16 @@ module ActionView
# Provides a set of methods for making it easier to locate problems.
module DebugHelper
# Returns a <pre>-tag set with the +object+ dumped by YAML. Very readable way to inspect an object.
+ # my_hash = {'first' => 1, 'second' => 'two', 'third' => [1,2,3]}
+ # debug(my_hash)
+ # => <pre class='debug_dump'>---
+ # first: 1
+ # second: two
+ # third:
+ # - 1
+ # - 2
+ # - 3
+ # </pre>
def debug(object)
begin
Marshal::dump(object)