Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Adding indent option to to_json method in Hash

#2632

By default the to_json output of a model is shown in a single line like this .

Sometimes it is better to see the whole JSON output without horizontal scrolling like this .

Attached is a patch that add another option to to_json method of HASH.

Usage. @user.to_json(:indent => 7)

Reported by Neeraj Singh · May 11th, 2009 @ 04:04 AM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 9th, 2010 @ 04:17 AM

  3. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 10:03 PM

  4. bingbing