Why does this go nowhere?

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”] = ‘[email protected]
@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/
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

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. [email protected]

On Jun 12, 8:43 pm, JannaB [email protected] 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

Thanks fred

On Jun 12, 4:17 pm, Frederick C. [email protected]