diff options
Diffstat (limited to 'railties/lib/generators/erb')
-rw-r--r-- | railties/lib/generators/erb/mailer/mailer_generator.rb | 19 | ||||
-rw-r--r-- | railties/lib/generators/erb/mailer/templates/view.erb | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/railties/lib/generators/erb/mailer/mailer_generator.rb b/railties/lib/generators/erb/mailer/mailer_generator.rb new file mode 100644 index 0000000000..2458762a9d --- /dev/null +++ b/railties/lib/generators/erb/mailer/mailer_generator.rb @@ -0,0 +1,19 @@ +module Erb + module Generators + class MailerGenerator < Base + argument :actions, :type => :array, :default => [] + + desc <<DESC +Description: + Create Template engine files for mailer generator. +DESC + + def create_view_files + actions.each do |action| + @action, @path = action, File.join(file_path, action) + template "view.erb", File.join("app", "views", "#{@path}.erb") + end + end + end + end +end diff --git a/railties/lib/generators/erb/mailer/templates/view.erb b/railties/lib/generators/erb/mailer/templates/view.erb new file mode 100644 index 0000000000..cda2cd24fe --- /dev/null +++ b/railties/lib/generators/erb/mailer/templates/view.erb @@ -0,0 +1,3 @@ +<%= class_name %>#<%= @action %> + +Find me in <%= @path %> |