NoMethodError on UserMailer:Class


#1

I’m baffled but this error:

NoMethodError: undefined method application_accepted' for UserMailer:Class from c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer /base.rb:385:inmethod_missing’
from D:/rails/app/models/applicant_observer.rb:11:in after_ save' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record /observer.rb:171:insend’
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record
/observer.rb:171:in update' from c:/ruby/lib/ruby/1.8/observer.rb:185:innotify_observers’
from c:/ruby/lib/ruby/1.8/observer.rb:184:in each' from c:/ruby/lib/ruby/1.8/observer.rb:184:innotify_observers’

here is the class in question

require ‘action_mailer/ar_mailer’
class UserMailer < ActionMailer::ARMailer

def signup_notification(user)
setup_email(user)
@subject += ‘Welcome to’
end

def application_accepted(application)
setup_email(application.position.account)
@subject += “#{application.name} accepted.”
@body[:application] = application
end

protected
def setup_email(user)
recipients “#{user.email}”
from FROM_MAILER_STRING # Sets the User FROM Name and Email
subject “”
body :user => user
sent_on Time.now
end
end

end

signup_notification works fine why would this other method?

Thanks,

GP


#2

make sure you’re calling it via
“UserMailer.create_application_accepted” or
“UserMailer.deliver_application_accepted”, not just
“UserMailer.application_accepted”

On Nov 12, 1:21 pm, Grayson P. removed_email_address@domain.invalid