# Missing something about these form parameters

**URL:** <https://www.ruby-forum.com/t/missing-something-about-these-form-parameters/169674>\
**Category:** Rails\
**Created:** [June 6, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/missing-something-about-these-form-parameters/169674 "2009-06-06T20:05:25Z")\
**Posts on this page:** 2\
**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 6, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/missing-something-about-these-form-parameters/169674/1 "2009-06-06T20:05:25Z")

</div>

If I have the following form:

# Send Email
\<% form\_remote\_tag :update =\> 'dud', :url =\> {:controller =\> 'emailer', :action =\> 'sendmail'} do %\>

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

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

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

\<%= 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: removed\_email\_address@domain.invalid  
Message: This is just a test!

Why is the output I am puts’ing, look like this?

messageThis is just a test!removed\_email\_address@domain.invalid

No wonder I cannot get the mail to send – why is it prefixing the  
variables with the names of the variables themselves? -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 6, 2009, 11:45pm UTC](https://www.ruby-forum.com/t/missing-something-about-these-form-parameters/169674/2 "2009-06-06T23:45:45Z")

</div>

On Jun 6, 7:02 pm, JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why is the output I am puts’ing, look like this?
> 
> messageThis is just a test!removed\_email\_address@domain.invalid
> 
> No wonder I cannot get the mail to send – why is it prefixing the  
> variables with the names of the variables themselves? -Janna B

Look at your log file. You’ll see that params[:email] is a hash (and  
that’s the thing you are puts-ing; the other two things are nil)

Fred
