2011-07-18 88 views
1

我想翻譯模型屬性(post.name)。在我看來,我有rails 3標籤i18n意外行爲

label :post, :name 
我en.yml

我有

en: 
    activerecord: 
    attributes: 
     post: 
     name: "Test" 

它只能如果我使用它在瀏覽後,但在其他的觀點是不(標籤文本是那裏的「名稱」)。這是預期的行爲(這個限制在the docs沒有提及),我可以做些什麼嗎?

+0

thx fl00r for ultra-fast edit – user573335

回答

1

這裏的遊戲有點晚了,剛剛遇到你的問題尋找另一個答案。

這裏你去:label :post, :name, Post.human_attribute_name(:name)