Forum: Ruby on Rails ActionMailer (Action Mailer) Template not found? Help!!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
51a4fd4c5ed993fb41425ea672167915?d=identicon&s=25 Lonny Eachus (lonny)
on 2006-05-24 02:36
I have been going around on the Internet about this all day and found
absolutely nothing that seems to fit this problem.

I have a mailer named "Notifier" -- in fact I have been using the EXACT
code from the "Agile Development With Rails" chapter on "Sending
E-Mail", pp. 411-416, except for my names (mailer named "Notifier",
emailer method named "report". And what I get is:

ActionView::ActionViewError in <my_controller>#<my_calling_method>

"No rhtml, rxml, rjs or delegate template found for report."

I generated the files with "script/server mailer Notifier report", and
there is indeed a template: apps/views/notifier/report.rhtml

I am calling it with:

  email = ErrNotifier.create_err_report( Time.now )
  render(:text => '<pre>' + email.encoded + '</pre>')

just as in the book. Please help! This error message makes no sense . .
. and to make matters worse, it actually started working for a few
minutes then stopped, giving the same error again! The
automatically-generated "notifier_test.rb" gives me exactly the same
error. The error is on the "create" line, NOT the render line! So it
should not be related to connection or smtp issues.

I have to get this working for an app that is about ready to go out. Any
help would be greatly appreciated.
51a4fd4c5ed993fb41425ea672167915?d=identicon&s=25 Lonny Eachus (lonny)
on 2006-05-24 02:39
Correction. The call above should read:

  email = Notifier.create_report( Time.now )
  render(:text => '<pre>' + email.encoded + '</pre>')

My problem is NOT a simple typo; that is just from another mailer I
generated in desperation. I have been messing with this all day and I am
frustrated.
This topic is locked and can not be replied to.