开发者

simple email causes stack level too deep

I have mailer:

class AdminMailer < ActionMailer::Base
  default :from => "pejottest@gmail.com" 
  def message
    mail(:to => "pejottest@gmail.com",:subject => "test")
  end
end

When I i use them from the controller :

def create
  AdminMailer.message.deliver
  redirect_to root_path
end

Th开发者_开发技巧en I got

SystemStackError in EmailsController#create
stack level too deep

Without any trace and so on.


I think you'll find the message method is reserved by Action Mailer. I would recommend calling your method different from this to prevent this conflict.

Thanks to Ben Lee in the comments for pointing out where this comes from.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜