If I have the following form:
<h1>Send Email</h1>
<% form_remote_tag :update => 'dud', :url => {:controller =>
'emailer', :action => 'sendmail'} do %>
<p><label for="email_subject">Subject</label>:
<%= text_field 'email', 'subject' %></p>
<p><label for="email_recipient">Recipient</label>:
<%= text_field 'email', 'recipient' %></p>
<p><label for="email_message">Message</label><br/>
<%= text_area 'email', 'message' %></p>
<%= submit_tag "Send", {:onclick => "pageLoad()" } %>
<% end %>
Which, upon Submit, executes the following controller method:
class EmailerController < ApplicationController
def sendmail
recipient = params[:email]
subject = params[:subject]
message = params[:message]
puts recipient
puts subject
puts message
Emailer.deliver_contact(recipient, subject, message)
return if request.xhr?
render :nothing => true
#render :text => 'Message sent successfully'
end
end
And I input the following data into the form::
Subject: test
Recipient: [email protected]
Message: This is just a test!
Why is the output I am puts'ing, look like this?
messageThis is just a [email protected]
No wonder I cannot get the mail to send -- why is it prefixing the
variables with the names of the variables themselves? -Janna B
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---