Skip to content
Browse files

docs for ActionMailer::Base.default_i18n_subject

  • Loading branch information...
1 parent 280a870 commit 082e299e978f705e6ceed747ead3d71ccba36ed4 @smartinez87 smartinez87 committed Apr 18, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 actionmailer/lib/action_mailer/base.rb
View
5 actionmailer/lib/action_mailer/base.rb
@@ -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

0 comments on commit 082e299

Please sign in to comment.
Something went wrong with that request. Please try again.