【问题标题】:how to represent an empty field in yaml如何在yaml中表示一个空字段
【发布时间】:2010-09-08 12:49:57
【问题描述】:

我正在使用轨道上的固定装置,我希望其中一个固定装置字段为空白。

例子:

two:
name: test
path: - I want this blank but not to act as a group heading.
test: 4

但是,如果不将 path: 作为组标题,我不知道如何将其留空。有人知道怎么做吗?

【问题讨论】:

    标签: ruby-on-rails yaml


    【解决方案1】:

    Google says 以下应该可以工作:

    path: \"\"
    

    【讨论】:

      【解决方案2】:

      YAML 文件基于缩进。一旦你真正拥有正确的缩进,它就会以与兄弟相同的级别读取所有内容。

      
      two:
        name: test
        path: 
        test: 4
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-01-08
        • 2012-03-09
        • 2011-07-03
        • 2022-12-18
        • 1970-01-01
        • 2012-08-07
        • 2013-05-08
        • 1970-01-01
        相关资源
        最近更新 更多