diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
commit | 88a3343ed57c01ca358da8473d15fc4d2b4a5bff (patch) | |
tree | 3fe773bb113480f68eaea508d241cbaf90eebfde /railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb | |
parent | 60f7a5cab73fab032fdb73d1a9a8061cf20031d2 (diff) | |
download | rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.gz rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.bz2 rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.zip |
Backed out of routing merge.. investigating missing patches
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb')
-rw-r--r-- | railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb b/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb index d8ddb43644..81d4599f7f 100644 --- a/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +++ b/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb @@ -4,28 +4,21 @@ class MailerGenerator < Rails::Generator::NamedBase # Check for class naming collisions. m.class_collisions class_name, "#{class_name}Test" - # Mailer, view, test, and fixture directories. - m.directory File.join('app/models', class_path) - m.directory File.join('app/views', class_path, file_name) - m.directory File.join('test/unit', class_path) - m.directory File.join('test/fixtures', class_path, table_name) - # Mailer class and unit test. - m.template "mailer.rb", File.join('app/models', - class_path, - "#{file_name}.rb") - m.template "unit_test.rb", File.join('test/unit', - class_path, - "#{file_name}_test.rb") + m.template "mailer.rb", "app/models/#{file_name}.rb" + m.template "unit_test.rb", "test/unit/#{file_name}_test.rb" + + # Views and fixtures directories. + m.directory "app/views/#{file_name}" + m.directory "test/fixtures/#{table_name}" # View template and fixture for each action. actions.each do |action| m.template "view.rhtml", - File.join('app/views', class_path, file_name, "#{action}.rhtml"), + "app/views/#{file_name}/#{action}.rhtml", :assigns => { :action => action } m.template "fixture.rhtml", "test/fixtures/#{table_name}/#{action}", - File.join('test/fixtures', class_path, table_name, action), :assigns => { :action => action } end end |