Simple email causes stack level too high

I have a mail program:

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

When I use them from the controller:

 def create AdminMailer.message.deliver redirect_to root_path end 

Then i got

 SystemStackError in EmailsController#create stack level too deep 

Without any marks, etc.

+4
source share
1 answer

I think you will find the message method is reserved by the 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.

+12
source

All Articles