diff options
author | Kir Shatrov <shatrov@me.com> | 2014-12-01 01:03:09 -0500 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2014-12-01 01:03:09 -0500 |
commit | 9c15d23a7771d883cf8235cb516eec611a6bee19 (patch) | |
tree | b3694cddd942a38520fb720d7b22cc7e1809a1c2 /actionpack/lib/action_dispatch/middleware/templates | |
parent | 8226bad7101fd35e774ca6d233c605c4cee2abd8 (diff) | |
download | rails-9c15d23a7771d883cf8235cb516eec611a6bee19.tar.gz rails-9c15d23a7771d883cf8235cb516eec611a6bee19.tar.bz2 rails-9c15d23a7771d883cf8235cb516eec611a6bee19.zip |
Pretty-print request params on exception page
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/templates')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb index db219c8fa9..761cd0ffcc 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb @@ -10,7 +10,14 @@ clean_params.delete("action") clean_params.delete("controller") - request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n") + request_dump = if clean_params.empty? + 'None' + else + pretty_params = "" + PP.pp(clean_params, pretty_params, 200) + + pretty_params + end def debug_hash(object) object.to_hash.sort_by { |k, _| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n") |