Skip to content

Commit

Permalink
docs for ActionMailer::Base.default_i18n_subject
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinez87 committed Apr 19, 2011
1 parent 280a870 commit 082e299
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actionmailer/lib/action_mailer/base.rb
Expand Up @@ -681,7 +681,10 @@ def set_content_type(m, user_content_type, class_default)
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
Expand Down

0 comments on commit 082e299

Please sign in to comment.