Rails Cannot See User_Notifier's methods!

Hey there, I’m attempting to set up a User_notifier that sends the
user an email with a reset password (a la RESTful Authentication’s
plugin–which I’m using). I get the following error any time I call
UserNotifier.deliver_<method_name>. I.e. in this case, when calling
UserNotifier.deliver_reset_password(user). Here’s the stack trace
from console:

UserNotifier.deliver_reset_password(User.find(1))
NoMethodError: undefined method reset_password' for #<UserNotifier: 0xb6e12178> from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/ base.rb:462:insend
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
base.rb:462:in create!' from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/ base.rb:455:ininitialize’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/
base.rb:392:in new' from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/ base.rb:392:inmethod_missing’
from (irb):2

This is driving me crazy, because I can certainly see a method within
user_notifier.rb called ‘reset_password.’ If anybody has any thoughts
at all, they’re EXTREMELY appreciated! been bangin my head against
the wall for quite a while.

Thanks for lookin,
Jared

Hi Jared,

I certainly hate to plug my own tutorials, but you should visit this one
and create the mailbag app I placed in the tutorial. By the time you
finish with it, you’ll understand everything you need to know to get
mailers working and also on how to utilize observers to send mail.

http://www.ruby-forum.com/topic/202316

If you have questions after, holler.

On Jan 19, 2:50Â am, jrgoodner [email protected] wrote:

This is driving me crazy, because I can certainly see a method within
user_notifier.rb called ‘reset_password.’ Â If anybody has any thoughts
at all, they’re EXTREMELY appreciated! Â been bangin my head against
the wall for quite a while.

Did you create a class method rather than an instance method ?

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs