rails/rails — pull request #17922 by kirs (2014-12-04 22:37:45+00:00)
Title: Display diagnostics in text format for xhr request

Backport of https://github.com/rails/rails/pull/14745 to 4.1-stable
More details: https://github.com/rails/rails/commit/a725a453b38057b46878afae39dc107ada2cf326#commitcomment-8835104
Thanks @jontebol for the report!