Class: Rodauth::Rails::Generators::MailerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rodauth/mailer_generator.rb

Constant Summary collapse

VIEWS =
%w[
  email_auth
  password_changed
  reset_password
  unlock_account
  verify_account
  verify_login_change
]

Instance Method Summary collapse

Instance Method Details

#copy_mailerObject



23
24
25
26
# File 'lib/generators/rodauth/mailer_generator.rb', line 23

def copy_mailer
  template "app/mailers/rodauth_mailer.rb",
    "app/mailers/#{options[:name].underscore}_mailer.rb"
end

#copy_mailer_viewsObject



28
29
30
31
32
33
# File 'lib/generators/rodauth/mailer_generator.rb', line 28

def copy_mailer_views
  VIEWS.each do |view|
    template "app/views/rodauth_mailer/#{view}.text.erb",
      "app/views/#{options[:name].underscore}_mailer/#{view}.text.erb"
  end
end