mailer_generator.rb 440 B

12345678910111213141516
  1. module Rails
  2. module Generators
  3. class MailerGenerator < NamedBase
  4. source_root File.expand_path("../templates", __FILE__)
  5. argument :actions, :type => :array, :default => [], :banner => "method method"
  6. check_class_collision
  7. def create_mailer_file
  8. template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb")
  9. end
  10. hook_for :template_engine, :test_framework
  11. end
  12. end
  13. end