Skip to content

Instantly share code, notes, and snippets.

@kzar
Created March 25, 2011 14:12
Show Gist options
  • Save kzar/886889 to your computer and use it in GitHub Desktop.
Save kzar/886889 to your computer and use it in GitHub Desktop.
First, broken attempt at getting prettier JSON back from Rails 3
#config/initializers/pretty_json.rb
module ActiveRecord
class Base
def to_json
JSON.pretty_generate(as_json)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment