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.
精彩评论