【问题标题】:How to translate attributes of table-less model?如何翻译无表模型的属性?
【发布时间】:2012-06-14 05:16:29
【问题描述】:

RailsCast #326 ActiveAttr 解释了如何创建无表模型。

如何翻译rails docs 中基于表格的属性所解释的属性?

【问题讨论】:

标签: ruby-on-rails internationalization active-attr


【解决方案1】:

不是通过 ActiveRecord(例如de.activerecord.attributes.message.subject: Betreff),而是必须引用 ActiveModel(例如de.activemodel.attributes.message.subject: Betreff)。

--由 stephenmurdoch in this comment概述

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-26
    • 1970-01-01
    • 1970-01-01
    • 2016-07-20
    • 2011-11-11
    • 1970-01-01
    • 1970-01-01
    • 2014-09-26
    相关资源
    最近更新 更多