0

メールにメーラー レイアウトを使用しようとしてnotifications_mailer.html.erbいます。レイアウト フォルダーに配置し、メールのビューを持っています。migration_message.html.haml

しかし、なぜこの内部サーバー エラー 500 が発生するのでしょうか。

自己終了タグにコンテンツを含めることはできません

私が持ってnotifications_mailer.html.erbいる:

<div class="article-content" align="left" style="font-size: 13px;line-height: 18px;color: #444;margin-top: 0;margin-bottom: 18px;font-family: 'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif">
   <%= yield %>
</div>   

これは、メーラー レイアウトに yield を追加する方法ではありませんか?

このエラーをどこでデバッグしますか? 実サーバーでテストする前にブラウザで電子メールをテストする宝石はありますか?

編集

コードmigration_message.html.haml

=content_for :title do
  Hello fan!
%p
  %span{:id => "internal-source-marker_0.12735640932997944"} We are happy to inform you about our new website, in which you can find new features. You have registered with us in our previous website, therefore we are very glad to inform you about our new one.
%p
  %span Take a look at the #{link_to 'Virtual Circuit Lab', lab_path} & check the Lab #{link_to 'Features', features_path}
  If you’ve already checked out the site, Follow our #{link_to 'Facebook page', "https://www.facebook.com/ourwebsite"} and invite a friend to do the same!
  %br/ 
4

1 に答える 1

0

質問の 2 番目の部分については、 Letter Openerと呼ばれる宝石があり、まさにあなたが望んでいることを実行します。メッセージを呼び出すdeliverと、メッセージを送信する代わりに、メッセージを含むブラウザーが開きます。

于 2012-12-31T11:38:41.627 に答える