2012-12-31 99 views
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> 

這不是在郵件程序佈局中添加收益的方法嗎?

哪裏應該調試這個錯誤?在真正的服務器上測試它們之前,有沒有在瀏覽器上測試電子郵件的寶石?

編輯

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

回答

0

至於問題的第二部分,有一個名爲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'}'並重新啓動應用程序。 –