1

When you get an error in a Rails application, using the default error handling you get output similar to the following:

http://i.imm.io/UDtV.png

The way that the Request Parameters section JSON is printed is very hard to read - it's impossible to see the hierarchy unless you pore through every line. Is there a way to have it displayed in a more readable way, using proper indentation? As an example:

{
    "utf8"=>"✓",
    "_method"=>"put",
    "authenticity_token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "task"=>{
        "title"=>"Task1",
        "instructions"=>"Do the task",
        "weighting"=>"10",
        "detail_attributes"=>{
            "is_yes_no"=>"false",
            "id"=>"1"
        },
    },
    ...
}
ultrafez
  • 543
  • 6
  • 19
  • http://stackoverflow.com/questions/6597359/ruby-on-rails-pretty-print-for-variable-hash-set-inspect-is-there-a-way-to – MrYoshiji Jan 30 '13 at 19:39
  • That looks great. Is there any way that can be integrated into the standard error output that is displayed during development? – ultrafez Jan 30 '13 at 20:02
  • 1
    You could also have a look at https://github.com/charliesome/better_errors it's awesome ! – pjam Jan 30 '13 at 21:00
  • This gem better_errors is great but we (team of 3 dev) had LocalJumpErrors happening randomly (was ~5 times a day for me, more like ~30 times a day for a colleague). – MrYoshiji Jan 30 '13 at 22:08

0 Answers0