Take the 2-minute tour ×

I am using a helper method to make my json pretty:

def make_pretty_json(json_object)
 if (Rails.env == "development" || Rails.env == "staging")

I then call the helper in my controller:

@jobs = make_pretty_json(@jobs)

and do a

respond_to do |format|
  format.json { 
    render json: @jobs

I have to do this manually for all my models. Is there a way to do this globally so I get Pretty Indented JSON only in certain ENVIRONMENTS?

share|improve this question

1 Answer 1

If you want a prettier view of your json just for yourself, i recommend the JsonView plugin for chrome:


share|improve this answer
Hey Karl, thanks for the answer. The front end dev is done via flash and they are tracing the output there so this won't help me! –  Madhan Feb 5 '13 at 22:36

Your Answer


