diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-21 00:29:44 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-02-21 00:29:44 +0000 |
commit | 21187c0fb4fc559927a2f947f909dedd85969ffb (patch) | |
tree | efd0ceb5c3a88531916186e97aa106041c293975 /actionmailer/lib/action_mailer/base.rb | |
parent | b5419cd66ea160d1ee94f3ca521bb44adf3a21ca (diff) | |
download | rails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.gz rails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.bz2 rails-21187c0fb4fc559927a2f947f909dedd85969ffb.zip |
Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 5de9331674..044ff46587 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -52,9 +52,9 @@ module ActionMailer #:nodoc: # # Like ActionController, each mailer class has a corresponding view directory # in which each method of the class looks for a template with its name. - # To define a template to be used with a mailing, create an <tt>.rhtml</tt> file with the same name as the method + # To define a template to be used with a mailing, create an <tt>.erb</tt> file with the same name as the method # in your mailer model. For example, in the mailer defined above, the template at - # <tt>app/views/notifier/signup_notification.rhtml</tt> would be used to generate the email. + # <tt>app/views/notifier/signup_notification.erb</tt> would be used to generate the email. # # Variables defined in the model are accessible as instance variables in the view. # @@ -103,7 +103,7 @@ module ActionMailer #:nodoc: # # = HTML email # - # To send mail as HTML, make sure your view (the <tt>.rhtml</tt> file) generates HTML and + # To send mail as HTML, make sure your view (the <tt>.erb</tt> file) generates HTML and # set the content type to html. # # class MyMailer < ActionMailer::Base @@ -142,10 +142,10 @@ module ActionMailer #:nodoc: # by the content type. Each such detected template will be added as separate part to the message. # # For example, if the following templates existed: - # * signup_notification.text.plain.rhtml - # * signup_notification.text.html.rhtml - # * signup_notification.text.xml.rxml - # * signup_notification.text.x-yaml.rhtml + # * signup_notification.text.plain.erb + # * signup_notification.text.html.erb + # * signup_notification.text.xml.builder + # * signup_notification.text.x-yaml.erb # # Each would be rendered and added as a separate part to the message, # with the corresponding content type. The same body hash is passed to @@ -383,14 +383,14 @@ module ActionMailer #:nodoc: unless String === @body # First, we look to see if there are any likely templates that match, # which include the content-type in their file name (i.e., - # "the_template_file.text.html.rhtml", etc.). Only do this if parts + # "the_template_file.text.html.erb", etc.). Only do this if parts # have not already been specified manually. if @parts.empty? templates = Dir.glob("#{template_path}/#{@template}.*") templates.each do |path| - # TODO: don't hardcode rhtml|rxml + # TODO: don't hardcode erb|builder basename = File.basename(path) - next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(rhtml|rxml)$/.match(basename) + next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(erb|builder|rhtml|rxml)$/.match(basename) template_name = basename content_type = md.captures[1].gsub('.', '/') @parts << Part.new(:content_type => content_type, |