发送 actionmailer 电子邮件时 Actionview 模板错误 - Ruby on Rails
每当我尝试向用户发送电子邮件时,我都会收到错误。以下是每天中午发送的:
<% @user.account.ideas.each do |idea| %> #this is the line that errors
<%= idea.title %>
<% end %>
这是错误:
scheduler caught exception :
ActionView::Template::Error
/Library/Ruby/Gems/1.8/gems/activesupport- 3.0.7/lib/active_support/whiny_nil.rb:48:in `method_missing'
我认为这是电子邮件无法与控制器交互的原因......有什么想法吗?我迷路了。谢谢。
I'm getting an error anytime I try and send out an e-mail to users. The below is sent out every day at noon:
<% @user.account.ideas.each do |idea| %> #this is the line that errors
<%= idea.title %>
<% end %>
Here's the error:
scheduler caught exception :
ActionView::Template::Error
/Library/Ruby/Gems/1.8/gems/activesupport- 3.0.7/lib/active_support/whiny_nil.rb:48:in `method_missing'
I think it's something with the email not being able to interact with controllers... any thoughts? I'm lost. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从警告来自
whiny_nil.rb
的事实来看,我愿意打赌@user.account
会返回nil
而不是而不是实际的Account
对象。在您的数据库中搜索没有帐户的用户,我认为至少有一个。Judging by the fact that the warning comes out of
whiny_nil.rb
, I'm willing to bet that@user.account
is returningnil
rather than an actualAccount
object. Search through your database for users without an account, I reckon there's at least one.