ActionView::TemplateError In Production Mode

Hello RoR Folks,

I’m working on document submission web app hosted at site5.com. 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:
16:
17: Submission Authors:
18: <% i = 1 -%>
19: <% @authors.each do |author| -%>
20: <%= i -%>. <%= author.lastname -%>, <%= author.firstname %>
21: <%= author.email %>
22: <% i += 1 %>

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

Model:
def send_upload(submission, login, authors)
@subject = ‘New Document Submission’
@body = { “login” => login,
“submission” => submission,
“authors” => authors }

View:
Submission Authors:
<% i = 1 -%>
<% @authors.each do |author| -%>
<%= i -%>. <%= author.lastname -%>, <%= author.firstname %>
<%= author.email %>
<% 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.

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 site5.com’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.

derrin

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