diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-01-18 21:22:09 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2010-01-18 21:22:09 -0600 |
commit | 71d67fc6bd504956bce66e274e6228dd00a814c1 (patch) | |
tree | 4cc5fa839e6578d21ce306bcef07b46a53b49da0 /actionpack/lib | |
parent | 5579de5bab2e9eeba26006705d7b18592948d185 (diff) | |
download | rails-71d67fc6bd504956bce66e274e6228dd00a814c1.tar.gz rails-71d67fc6bd504956bce66e274e6228dd00a814c1.tar.bz2 rails-71d67fc6bd504956bce66e274e6228dd00a814c1.zip |
Prettier hash dump
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb index 7465f2c69b..839df50999 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb @@ -11,16 +11,20 @@ clean_params.delete("controller") request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n") + + def debug_hash(hash) + hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect}" }.join("\n") + end %> <h2 style="margin-top: 30px">Request</h2> <p><b>Parameters</b>: <pre><%=h request_dump %></pre></p> <p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p> -<div id="session_dump" style="display:none"><%= debug(@request.session) %></div> +<div id="session_dump" style="display:none"><pre><%= debug_hash @request.session %></pre></div> -<p><a href="#" onclick="document.getElementById('env_dump').style.display='block'; return false;">Show Rack ENV</a></p> -<div id="env_dump" style="display:none"><%= debug(@request.env) %></div> +<p><a href="#" onclick="document.getElementById('env_dump').style.display='block'; return false;">Show env dump</a></p> +<div id="env_dump" style="display:none"><pre><%= debug_hash @request.env %></pre></div> <h2 style="margin-top: 30px">Response</h2> |