【发布时间】:2010-02-13 20:41:41
【问题描述】:
希望有人能指出我正确的方向。我有一个 en.yml 文件
en:
hello: "Hello world"
activerecord:
models:
recipe: "Recipe"
attributes:
recipe:
title: "Recipe title"
errors:
models:
recipe:
attributes:
title:
blank: "{{attribute}} cannot be left blank"
在我的模型中,我验证了标题字段的存在
validates_presence_of :title
但是,我在页面上看到的错误消息是这样的
Recipe title Recipe title cannot be left blank.
我无法弄清楚为什么属性名称重复了两次。
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails internationalization