Forum: Ruby on Rails actionmailer - TypeError: can't dup NilClass

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fddbb3cd16868f4741c2e86ef015a639?d=identicon&s=25 Sergio T. Ruiz (sergio101)
on 2009-03-09 16:04
i am currently writing a mailer, and running into several problems
that i have not run into before..

suddenly, rails is asking me for the following:

ActionView::ActionViewError (Due to changes in ActionMailer, you need to
provide the mailer_name along with the template name.

i have changed my my file model to look like this:

,----[ notifier ]
| class Notifier < ActionMailer::Base
|   def files_expiring(user_id)
|     recipients ''
|     bcc ""
|     from ""
|     subject "some subject"
|     render :file => "notifier/expire_files"
|   end
| end

when i run this, everything seems to be okay, but i get the following

,----[ error message ]
| >> Notifier.deliver_files_expiring(25)
| Notifier.deliver_files_expiring(25)
| TypeError: can't dup NilClass
|   from 
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/template_error.rb:11:in `dup'
|   from 
|   from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:322:in `new'
|   from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:322:in 
|   from /Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:348:in 
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:502:in 
|   from /Users/sergio/Sites/file_manager/app/models/notifier.rb:7:in `files_expiring'
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:410:in 
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:410:in 
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:403:in 
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in 
|   from /Library/Ruby/Gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in 
|   from (irb):41

at this point, the view has only some text in it, no reference to any

any help would be greatly appreciated...

This topic is locked and can not be replied to.