I've done PHP and was able to get JSON format to display nicely using
<pre></pre>
Now I'm trying to figure out how would you apply something similar with Ruby on Rails?
In my views document, I have this:
<%= @recent_media_items.to_json %>
<pre><%= @recent_media_items.to_json %></pre>
? <pre> is HTML, not PHP...
I recommend trying CodeRay gem. It will do all the work for you. Just send to it your JSON and you'll get nice, colorized output:
html = CodeRay.scan("{\"Hello\":\"world!\"}", :json).div
or in your case
<%= CodeRay.scan(@recent_media_items.to_json, :json).div %>