自闭标签不能有内容?

时间:2012-12-31 05:19:11

标签: ruby-on-rails-3 ruby-on-rails-3.2 haml mailer

我正在尝试为我的电子邮件使用邮件程序布局, 我已将notifications_mailer.html.erb放在layouts文件夹中,并且我有一个电子邮件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>   

这不是在邮件程序布局中添加收益的方法吗?

在哪里调试此错误?在真实服务器上测试电子邮件之前,是否有一个宝石可以在浏览器上测试电子邮件?

修改

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/ 

1 个答案:

答案 0 :(得分:0)

关于问题的第二部分,有一个名为Letter Opener的宝石可以完全按照您的意愿行事。当您在邮件上拨打deliver时,它会打开一个包含该邮件的浏览器,而不是发送邮件。