Created
January 21, 2015 18:55
-
-
Save crwang/e5848cf6ed463426a6dc to your computer and use it in GitHub Desktop.
Rails pretty print hash in json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pretty_json = JSON.pretty_generate(JSON.parse(my_hash.to_json)) | |
render json: pretty_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment