aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/erb/mailer/mailer_generator.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
index e2f142fd02..f9b3658ae7 100644
--- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
+++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
@@ -9,7 +9,10 @@ module Erb # :nodoc:
view_base_path = File.join("app/views", class_path, file_name)
empty_directory view_base_path
- layout_base_path = "app/views/layouts"
+ formats.each do |format|
+ layout_path = File.join("app/views/layouts", filename_with_extensions("mailer", format))
+ template filename_with_extensions(:layout, format), layout_path
+ end
actions.each do |action|
@action = action
@@ -17,9 +20,6 @@ module Erb # :nodoc:
formats.each do |format|
@path = File.join(view_base_path, filename_with_extensions(action, format))
template filename_with_extensions(:view, format), @path
-
- layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format))
- template filename_with_extensions(:layout, format), layout_path
end
end
end