Ruby mailer is coming up with an EOFError

Posted by Deadder on Stack Overflow See other posts from Stack Overflow or by Deadder
Published on 2010-06-14T16:15:56Z Indexed on 2010/06/15 5:12 UTC
Read the original article Hit count: 248

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

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby