相关疑难解决方法(0)

如何在Ruby on Rails中"漂亮"格式化我的JSON输出?

我希望Ruby on Rails中的JSON输出"漂亮"或格式良好.

现在,我打电话to_json,我的JSON全部在一条线上.有时,如果JSON输出流中存在问题,则很难看到.

有没有办法配置或方法使我的JSON在Rails中"漂亮"或格式良好?

ruby json ruby-on-rails pretty-print

600
推荐指数
14
解决办法
28万
查看次数

正确的JSON格式

这是正确的json格式吗?

{
    "count": {
        "hbase": 66,
        "java": 63,
        "spring": 41,
        "Sample": 39,
        "minify": 36,
        "TS-WS1": 28,
        "jprofiler": 26,
        "logging": 24,
        "SCM": 24,
        "csrfguard": 20,
        "ldap": 19,
        "hadoop": 18,
        "jquery": 18,
        "android": 17,
        "TS-WS2": 17,
        "myplace": 16,
        "jvm": 16,
        "daily": 15,
        "oops": 15,
        "node.js": 15,
        "long": 15,
        "css3": 13,
        "html5": 13,
        "jms": 13,
        "ci": 11,
        "node": 11,
        "backlog": 11,
        "jsf": 10,
        "groovy": 10,
        "outofmemory": 9,
        "adf": 9,
        "Exception": 9,
        "guidelines": 9,
        "abc": 9,
        "liferay": 8,
        "performance": 7,
        "Groovy": 7,
        "jenkin": 7, …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery json

1
推荐指数
1
解决办法
370
查看次数

标签 统计

json ×2

ajax ×1

javascript ×1

jquery ×1

pretty-print ×1

ruby ×1

ruby-on-rails ×1