Given the class:
class UserMailer < ActionMailer::Base
default from: "do-not-reply@mark.com"
def contact_email(contact)
@contact = contact
mail(to: 'm@mark.com', from: @contact.email, subject: "Website Contact")
end
end
and the following test code:
c = Contact.new
UserMailer.contact_email(c)
How is it that this code works? I thought my contact_email was an instance method, but it is being invoked as a class method, and it works.
thanks for your help - as I learn Ruby and Rails :)
-mark