【发布时间】:2011-08-17 16:09:49
【问题描述】:
在我三年的 RoR 中从来没有听说过这个错误。~
我什至无法调试它,因为它没有告诉我它是如何/为什么出错的。
有什么想法吗?
日志
Processing Admin::EmailsController#test_email (for 69.114.195.64 at 2011-08-17 08:52:00) [GET]
Parameters: {"body"=>"null", "action"=>"test_email", "mail_type"=>"magic_email", "subject"=>"HQMagic Email... Surprise!", "controller"=>"admin/emails", "_"=>"1313596294081", "email"=>"daniel.levine4@gmail.com"}
ActionView::TemplateError (Need controller and action!) on line #25 of app/views/notifier/magic_email.html.haml:
22: %div{:style => "clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;"}
23: .main-image{:style => "height: 262px;"}
24: - if @email.main_deal_pic.url(:format) || @email.main_deal_pick_target
25: = link_to image_tag(@email.main_deal_pic.url(:format), :style => "margin: 0 0 0 4px; display: block; border: 0;"), @email.main_deal_pic_target, :style => "border: 0;"
26: %div{:style => "clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;"}
27: %img.header-middle{:src => "http://hqchannel.com/images/me-header-middle.jpg", :style => "display: block; margin: 0;"}
28: %div{:style => "clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;"}
【问题讨论】:
-
什么是
@email.main_deal_pic_target? -
这是用户点击 @email.main_deal_pic 时访问的 URL。它们都有有效的数据条目。完全相同的数据适用于我的测试。
-
尝试将其替换为:
(@email.main_deal_pic_target || "hey") -
有趣,看起来绕过了错误。但现在我的网址说“嘿” :D~ 。你认为为什么会这样?
标签: ruby-on-rails