1

I was reading the rails doc about ActionMailer and I came out with a question when I read the following code:

# Tell the UserMailer to send a welcome Email after save
UserMailer.welcome_email(@user).deliver

the question is: are the methods declared in the ActionMailer class all static? Because the action welcome_email is called on a class.

zer0uno
  • 7,521
  • 13
  • 57
  • 86
  • For all intents & purposes, I'd say the naming conventions of the functions need to remain independent to each other. If you're getting a conflict (or potential conflict), what is wrong with creating a different function name? My .02! – Richard Peck Nov 24 '13 at 13:31

1 Answers1

2

The methods aren't really static, but ActionMailer defines a method_missing implementation that searchs its instance methods; if found, they'll call it. So, in practice, it works like static methods.

EDIT

I did a little digging 'round stackoverflow and found this answer. I recommend you reading it =]

Community
  • 1
  • 1