自闭标签不能有内容?

问题描述:

我试图使用邮件布局我的电子邮件, 我已经把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> 

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

哪里应该调试这个错误?在真正的服务器上测试它们之前,有没有在浏览器上测试电子邮件的宝石?

编辑

代码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

你可以发布'migration_message.html.haml'的代码吗? –

+0

请参阅上面的编辑 – simo

至于问题的第二部分,有一个名为Letter Opener,你想要做什么宝石。当您在消息上调用deliver时,它将打开浏览器并显示消息,而不是发送消息。

+0

谢谢,它似乎是一个有用的宝石,但是,当我尝试使用它时出现此错误:缺少主机链接!请提供:host参数,设置default_url_options [:host],或者将only_path设置为true 您之前是否收到过此错误? – simo

+0

否。尝试将此行放在'config/environments/development.rb':'config.action_mailer.default_url_options = {:host =>'localhost:3000'}'并重新启动应用程序。 –