开发者

Is there any limitation on YAML indentation level?

I am developing a Ruby on Rails application with I18n support. I created a YAML file. But Rails report there is syntax error in the YAML file.

I found that if I decrease the level of indentation for that error line, no error message come out again.

Is there any limitation on YAML indentation level (in Ruby on Rails)?

Here is YAML block. The line fulltime: "Full Time" was reported has syntax error.

en:
  jobs:
    new:
      positiontitle:    "Position Title"
      country:          "Coun开发者_运维技巧try"
      city:             "City"
      employmenttype:   "Employment Type"
        fulltime:         "Full Time"
        parttime:         "Part Time"

Thanks everyone. :)


there's no limitation. possible cause of error is using a TAB characters instead of spaces when indenting YAML file lines

also your yaml file indentation is meaningless - if you want to indent fulltime & parttime - then you have to remove "Employment Type" string, so:

en:
  jobs:
    new:
      positiontitle:    "Position Title"
      country:          "Country"
      city:             "City"
      employmenttype:
        fulltime:         "Full Time"
        parttime:         "Part Time"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜