# Why does this go nowhere?

**URL:** <https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148>\
**Category:** Rails\
**Created:** [June 12, 2009, 9:43pm UTC](https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148 "2009-06-12T21:43:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [June 12, 2009, 9:43pm UTC](https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148/1 "2009-06-12T21:43:44Z")

</div>

Ok, I just cant seem to understand this. I have an ActionMailer model:

class Emailer \< ActionMailer::Base  
def contact(recipient, subject, message, returnadd, sent\_at =  
Time.now)  
@subject = subject  
@recipients = recipient  
@from = returnadd  
@sent\_on = sent\_at  
@body[“title”] = ‘This is title’  
@body[“email”] = ‘removed\_email\_address@domain.invalid’  
@body[“message”] = message  
@headers = {}  
# repl last line and use below to send html email if not set  
in /environments/\*.rb file:  
# @headers = {content\_type =\> ‘text/html’}  
end  
end

I have a form to implement the model:

# Send Email
\<% form\_remote\_tag :update =\> 'contaner', :url =\> {:controller =\> 'emailer', :action =\> 'sendmail'}, :html =\> {:name =\> 'form'+(params [:id]).to\_s} do %\>

Subject: \<%= text\_field 'email', 'subject' %\>

Recipient: \<%= text\_field 'email', 'recipient', :readonly =\> 'true' %\>

Message  
\<%= text\_area 'email', 'message' %\>

\<%= submit\_tag "Send" %\> \<% end %\>

When ‘Submit’ is clicked, it invokes the sendmail functino in my  
EmailerController:

class EmailerController \< ApplicationController  
def sendmail  
recipient = params[:email][:recipient]  
subject = params[:email][:subject]  
message = params[:email][:message]  
returnadd = current\_associate.email  
mymail = Emailer.create\_contact(recipient, subject, message,  
returnadd)  
Emailer.deliver(mymail);  
end  
end

Which SHOULD then render by /views/emailer/sendmail.erb

Message Sent!  
  
  
\<%= link\_to "Continue", :controller =\> 'application', :action =\> 'home' %\>

But NOTHING happens in the view, my log shows that is should be  
rendered:

Rendering template within layouts/application  
Rendering emailer/sendmail  
[4;35;1mSQL (0.0ms) [0m [0mSELECT count(\*) AS count\_all FROM  
`associates` WHERE (last\_request\_at \> ‘2009-06-12 15:28:25’) [0m  
Rendered layouts/\_whereabouts (0.0ms)  
Completed in 2578ms (View: 16, DB: 32) | 200 OK [[http://127.0.0.1/](http://127.0.0.1/)  
emailer/sendmail]

why does nothing change on my screen – I still see my Send Email  
form? What am I missing here (it must be so obvious, but I simply  
don;t see it!) -Janna B

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [June 12, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148/2 "2009-06-12T22:32:24Z")

</div>

yep…that was it (I knew it was something stupid I was doing but  
couldnt see it) Thanks Fred! -Janna

On Jun 12, 4:17 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [June 12, 2009, 10:18pm UTC](https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148/3 "2009-06-12T22:18:18Z")

</div>

On Jun 12, 8:43 pm, JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> why does nothing change on my screen – I still see my Send Email  
> form? What am I missing here (it must be so obvious, but I simply  
> don;t see it!) -Janna B

Because you meant to write :update =\> ‘container’ but wrote :update =\>  
‘contaner’ instead ?

If you did mean to write ‘contaner’, is that the id of an element on  
your page somewhere ?

Lastly, an awesome tool for working with this sort of stuff is Firebug

Fred

---

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [June 12, 2009, 10:31pm UTC](https://www.ruby-forum.com/t/why-does-this-go-nowhere/170148/4 "2009-06-12T22:31:13Z")

</div>

Thanks fred

On Jun 12, 4:17 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
