In one of my mailer methods I used a variable title ‘@subject’. By default, I was expecting this to be present in the corresponding view. However, after wasting quite some time looking around, I realized that the problem was in the variable name. Changing it to anything but @subject worked. Is there a place where these keywords are defined, I google around but didn’t find any such listing?
Share
Hey @Wahaj first of all @subject is not keyword!, you can use reflection to get information about class before using it.
http://en.wikipedia.org/wiki/Reflection_(computer_programming)#Ruby
You can get all instance method by
object_or_class.instance_methodsmessage or just callobject.methodswill return available methods, there is lots more google itNow when you call action mailer method like
it return
Mail::Messageobject https://github.com/rails/rails/blob/master/actionmailer/lib/action_mailer/base.rb#L143here is result of Mail::Message reflection
it seems that
subjectisattr_accessorinMail::Messageclass but it is not, subject getter and setter are setting subject value in a header hash..