Josh Moore
Josh Moore

Reputation: 13558

how to represent an empty field in yaml

I am working with fixtures on rails and I want one of the fixture fields to be blank.

Example:

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

But, I do not know how to leave path: blank without it acting as a group title. Does anybody know how to do that?

Upvotes: 8

Views: 7771

Answers (2)

Tom
Tom

Reputation: 408

YAML files are based on indentation. Once you actually have correct indentation it will read everything at the same level as siblings.


two:
  name: test
  path: 
  test: 4

Upvotes: 7

Paul Wicks
Paul Wicks

Reputation: 65600

Google says the following should work:

path: \"\"

Upvotes: 1

Related Questions