Pretty printing JSON with RubyEditCreated 6/23/2014, updated 5/18/2017require 'json' JSON.pretty_generate(JSON[input]) Source http://stackoverflow.com/questions/86653/how-can-i-pretty-format-my-json-output-in-ruby-on-rails rubyjavascriptjsonwiki