Ruby mailer is coming up with an EOFError
- by Deadder
I am getting an EOFError (End Of File Error) on this code in my controller. The block where the error appears is at the end of the line that says UserMailer.deliver_message( I am unaware as to how to fix this, I have been stuck for about 2 months and this site was suggested. Please help.
def contact
@title= "Contact Us"
if request.post?
@message= Message.new(params[:contact])
if @message.valid?
UserMailer.deliver_message(
:message => @message
)
flash[:notice] = "Thank you for contacting us"
redirect_to contact_url
end
end
end
Here is the message file:
<%= @mail.name %> has sent feedback or a question:
Message: <%= @mail.body %>
From: <%= @mail.email %>
And here is the UserMailer
class UserMailer < ActionMailer::Base
def message(mail)
subject 'Feedback/Questions'
recipients 'Email@email'
from 'webmaster'
body mail
end
end