Class: ActionMailer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/translator.rb

Instance Method Summary collapse

Instance Method Details

#translate(key, options = {}) ⇒ Object Also known as: t

Add a translate (or t) method to ActionMailer that is context-aware of what mailer and action is being invoked. Initial scoping of [:mailer_name :action_name] where mailer_name is like ‘comment_mailer’ and action_name is ‘comment_notification’ (note: no “deliver_” or “create_”)



336
337
338
# File 'lib/translator.rb', line 336

def translate(key, options={})
  Translator.translate_with_scope([self.mailer_name, self.action_name], key, options)
end