Action not found in Mailer preview

Viewed 737

I'm having a weird issue with my TransactionMailer Preview. I have the file test/mailers/previews/transaction_mailer_preview.rb looking good.

When i access http://localhost:3000/rails/mailers/ i can see the TransactionMailer preview and all of its actions and the mailer preview is rendered correctly.

However, as soon as i refresh, the mailer disappears from the list and the action cannot be found. The issue is fixed if i restart the server, but only for one time, then disappears again!

Any idea? Rails 5.2 and MiniTest standard.

1 Answers

For me this issue came up because I defined the Devise Mailer Preview in the file devise_mailer_preview.rb like this:

class Devise::MailerPreview < ActionMailer::Preview

in Rails 5 the convention though seems to use:

class DeviseMailerPreview < ActionMailer::Preview

This fixes the issue of disappearing Mailer Previews after editing.

Related