The problem is that you cannot use lazy search in decorators because they have no context for determining the level of the presentation file (index, show, edit, etc.). Therefore, out of the box you just need to describe anything you like, for example t('subjects.show.edit')
or something else.
Here is what I did to make it work for me.
class ApplicationDecorator < Draper::Base def translate(key, options={}) if key.to_s[0] == '.' key = model_class.to_s.downcase.pluralize + key end I18n.translate(key, options) end alias :t :translate end
This will not give you the full link of subjects.show.edit
, you just get subjects.edit
, but it seemed to me better than nothing.
source share