Class: Rails::Generators::MailerGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/rails/generators/mailer/mailer_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_mailer_fileObject


12
13
14
15
16
17
18
19
20
# File 'lib/rails/generators/mailer/mailer_generator.rb', line 12

def create_mailer_file
  template "mailer.rb", File.join("app/mailers", class_path, "#{file_name}_mailer.rb")

  in_root do
    if behavior == :invoke && !File.exist?(application_mailer_file_name)
      template "application_mailer.rb", application_mailer_file_name
    end
  end
end