0

我对使用 rails yaml 文件有点困惑。

我的应用程序抛出以下错误

I18n::InvalidLocaleData

我的 yaml 文件是

en:
  auth:
    register:
        success: "Successfully registered"
        error: "Please correct the errors"

我的控制器是

class AuthController < ApplicationController

def register
    blahblah
    flash[:error] = t '.auth.register.error'
end

任何人都可以帮助如何使用yaml。我检查了它显示的yamlintvalid YAML

4

1 回答 1

0

register:success: "Successfully registered"行之间的缩进不是错误的吗?那里似乎还有 2 个空格,还请记住,您必须使用空格并避免使用制表符,确保您使用的是空格。

于 2013-09-07T22:31:32.297 回答