Ace Suares user1266770
Ace Suares user1266770

Reputation: 419

in YAML, how to assign a string to a key that has subkeys?

In YAML, for I18n Rails translations, I have

en:
  mainkey:
    subkey: 'Some Text'

I can retrieve en.mainkey.subkey, but how can I assign a text to en.mainkey !?

Upvotes: 1

Views: 1348

Answers (1)

mpartel
mpartel

Reputation: 4492

You can't. The value of en.mainkey is the hash containing subkey. It can't also be a string. You can e.g. put it under another key next to subkey.

Upvotes: 1

Related Questions