1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

docs for ActionMailer::Base.default_i18n_subject

This commit is contained in:
Sebastian Martinez 2011-04-18 23:37:27 -03:00
parent 280a870992
commit 082e299e97

View file

@ -681,7 +681,10 @@ module ActionMailer #:nodoc:
end
end
def default_i18n_subject #:nodoc:
# Translates the +subject+ using Rails I18n class under <tt>[:actionmailer, mailer_scope, action_name]</tt> scope.
# If it does not find a translation for the +subject+ under the specified scope it will default to a
# humanized version of the <tt>action_name</tt>.
def default_i18n_subject
mailer_scope = self.class.mailer_name.gsub('/', '.')
I18n.t(:subject, :scope => [mailer_scope, action_name], :default => action_name.humanize)
end