开发者

Weird error when delivering mail : undefined method `index' for 2011-09-09 22:15:28 +0200:Time

When I deliver emails I开发者_如何转开发 get this weird error :

 Failure/Error: publication = FactoryGirl.create(:publication, :author => author)
 NoMethodError:
   undefined method `index' for 2011-09-09 22:15:28 +0200:Time

And the stack trace is not of any help.

Any idea ?


Very simple, you should NOT use :

default :sent_on => Time.now

in your mailer class.

Was tricky though :)


I've got this error when I passed (mistakenly) the :headers parameter to the mail method. After removing :headers (and using the headers method instead) it worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜