【发布时间】:2011-10-19 10:28:40
【问题描述】:
我使用 Draper gem 来装饰我的模型。这里我有非常经典的设置:
# app/decorators/subject_decorator.rb
class SubjectDecorator < ApplicationDecorator
decorates :subject
def edit_link
h.link_to(h.t('.edit'), '#')
end
end
我使用 i18n 进行国际化。但是当我运行它时,我得到:
Cannot use t(".edit") shortcut because path is not available
所以我想知道以前是否有人这样做过?它应该很简单。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 internationalization decorator