views:

24

answers:

1

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:          "Country"
      city:             "City"
      employmenttype:   "Employment Type"
        fulltime:         "Full Time"
        parttime:         "Part Time"

Thanks everyone. :)

+1  A: 

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"
zed_0xff
Thanks mate. I need "Employment Type" string in my app. So I add a line before fulltime for store that string, and leave employmenttype as what you type.
siulamvictor