I have a PageController that displays a form. The form is just
straight HTML, I only used the form helpers for the form tag as so:
–
<%= form_tag({:action => :send_request}, {:method=>:post,
:name=>‘childsplay’})%>
In my page controller I have this:
–
def send_request
email = InfoMailer::deliver_sendrequest(params)
end
in my action mailer class I have this:
controllers/info_mailer.rb
class InfoMailer < ActionMailer::Base
def sendrequest(formparms)
sent_at = Time.now
@to = ‘[email protected]’
@cc = ‘[email protected]’
@subject = ‘Thank you for your request’
@recipients = ‘’
@from = ‘[email protected]’
@sent_on = sent_at
@headers = {}
@body['name'] = formparms[:from_name]
end
end
The error I get is this:
ActionView::ActionViewError in Page#send_request
No rhtml, rxml, or delegate template found for sendrequest.rhtml
I REALLY DO have a a rhtml file at views/info_mailer/sendrequest.rhtml
it contains the following:
Dear <%=@from_name %>,
Thank you for your request, we will respond shortly!
Any ideas? … when I assign a body the message I want to send:
def sendrequest(formparms)
sent_at = Time.now
@to = ‘[email protected]’
@cc = ‘[email protected]’
@subject = ‘Thank you for your request’
@recipients = ''
@from = '[email protected]'
@sent_on = sent_at
@headers = {}
#@body = ‘Thank you, the request is being processed’
end
That works ok, it just doesn’t seem to be finding the template. What
am I doing wrong??