The problem is as follows:
to create this mailer you use this command
$rails generate mailer UserMailer account_activation password_reset
sending back
create app/mailers/user_mailer.rb create app/mailers/application_mailer.rb invoke erb create app/views/user_mailer create app/views/layouts/mailer.text.erb create app/views/layouts/mailer.html.erb invoke test_unit create test/mailers/user_mailer_test.rb create test/mailers/previews/user_mailer_preview.rb
in a weird way app/views/layouts/mailer.html.erb file is not generated, so when you call
layout 'mailer'
the core of the rails will send you this error
"Missing layout template / mailer"
You can solve this in two ways.
First: comment or delete the 'mailer' layout.
Second: Create a file.
Other methods, such as mock mail, are incorrect methods because this syntax makes no sense to Rails.
If you are creating a file, use this code to populate it.
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> </style> </head> <body> <%= yield %> </body> </html>
Daniel Jose Padilla Peรฑa
source share