rails, yml, & multiline

2019-05-14 17:44发布

问题:

i cannot for the life of me get multiline yaml from my locale files to work.

i have tried every combination of multiple solutions with no success.

i have tried key: |, key: >, with double quotes, with singles quotes, with \n, with the value on the next line, indented, and probably some others.

and in my view i am just using t('key')

im tearing my hair out over here. any other suggestions or possible reasons the default yaml specs for multiline values are not working?

回答1:

From some fooling around in irb, it looks like you might want:

key: |-
  abc
  def