Forum: Ruby on Rails ActionView::TemplateError In Production Mode

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.
Caf6a7232309ba4c28a36410ed2b2fdc?d=identicon&s=25 (Guest)
on 2007-02-23 23:22
(Received via mailing list)
Hello RoR Folks,

I'm working on  document submission web app hosted at  I've
run into an issue that I can't seem to solve.  I'm using ActionMailer
to send an email any time a document is submitted.  My code is bombing
out when processing the template for the mailer.  Here is an excerpt
from the product log file:

ActionView::TemplateError (undefined method `each' for nil:NilClass)
on line #19 of app/views/document_mailer/send_upload.rhtml:
17: Submission Authors:
18: <% i = 1 -%>
19: <% @authors.each do |author| -%>
20:   <%= i -%>. <%= author.lastname -%>, <%= author.firstname %>
21:      <%= %>
22:   <% i += 1 %>

Relevant code from the controller:
    # Find the login, submission and authors associated with this
    @login = Login.find(session[:id])
    @submission = Submission.find(session[:sub_id])
    @authors = Participant.find(:all, :conditions =>
                        [ "submission_id = ?", session[:sub_id] ] )

  def send_upload(submission, login, authors)
    @subject    = 'New Document Submission'
    @body       = { "login"       => login,
                    "submission"  => submission,
                    "authors"     => authors }

Submission Authors:
<% i = 1 -%>
<% @authors.each do |author| -%>
  <%= i -%>. <%= author.lastname -%>, <%= author.firstname %>
     <%= %>
  <% i += 1 %>
<% end -%>

The strange thing is that this code works properly when the app is in
development mode.  I am a RoR neophite, this being my first Rails
app.  So hopefully there is a simple step that I am missing.  Thanks
for your help.
Caf6a7232309ba4c28a36410ed2b2fdc?d=identicon&s=25 (Guest)
on 2007-02-23 23:38
(Received via mailing list)
Don't you hate folks that follow up their original post with more
details... Anyway, contrary to my earlier post, it does not matter if
the app is in development or production mode.  What does matter is
whether or not I'm using's fast cgi.

In my .htaccess file, flopping back and forth between dispatch.fcgi
and dispatch.cgi will cause my original problem.  But of course, I
don't want to use the regular cgi as it is slow like slug.

#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

Any insight is greatly appreciated.

This topic is locked and can not be replied to.