[英]Action not found in Mailer preview
I'm having a weird issue with my TransactionMailer Preview.我的 TransactionMailer 预览有一个奇怪的问题。 I have the file
test/mailers/previews/transaction_mailer_preview.rb
looking good.我有文件
test/mailers/previews/transaction_mailer_preview.rb
看起来不错。
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.当我访问
http://localhost:3000/rails/mailers/
我可以看到 TransactionMailer 预览及其所有操作,并且邮件程序预览已正确呈现。
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.
Rails 5.2 和 MiniTest 标准。
For me this issue came up because I defined the Devise Mailer Preview in the file devise_mailer_preview.rb
like this:对我来说,出现这个问题是因为我在文件
devise_mailer_preview.rb
定义了 Devise Mailer Preview,如下所示:
class Devise::MailerPreview < ActionMailer::Preview
in Rails 5 the convention though seems to use:在 Rails 5 中,约定似乎使用:
class DeviseMailerPreview < ActionMailer::Preview
This fixes the issue of disappearing Mailer Previews after editing.这解决了编辑后邮件程序预览消失的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.