# Passing variables from View to Controller

**URL:** <https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597>\
**Category:** Rails\
**Created:** [August 8, 2007, 11:59pm UTC](https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597 "2007-08-08T23:59:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 8, 2007, 11:59pm UTC](https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597/1 "2007-08-08T23:59:30Z")

</div>

Hi!

I was wondering if somebody would be able to help me out here for a  
second. I would like to pass a variable from the view into the  
controller. An example would look like this…

\<%= text\_area ‘business’, ‘acceptinfo’ %\>

How would I be able to get the controller to read what the user puts  
into the text area?

Thanks!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 9, 2007, 12:14am UTC](https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597/2 "2007-08-09T00:14:33Z")

</div>

removed\_email\_address@domain.invalid wrote:

> How would I be able to get the controller to read what the user puts  
> into the text area?

It’ll be in the params hash.

–  
Michael W.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 9, 2007, 1:59am UTC](https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597/3 "2007-08-09T01:59:41Z")

</div>

Thank you for the response.

So, for example, it would be…

params[:business.acceptinfo]

or something like that? I thought I tried it but I’ll give it another  
shot. I’m not in front of the box right now…but I’ll try it later  
on.

Thanks!  
Mike

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 9, 2007, 9:05am UTC](https://www.ruby-forum.com/t/passing-variables-from-view-to-controller/111597/4 "2007-08-09T09:05:17Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Thank you for the response.
> 
> So, for example, it would be…
> 
> params[:business.acceptinfo]
> 
> or something like that? I thought I tried it but I’ll give it another  
> shot. I’m not in front of the box right now…but I’ll try it later  
> on.

It would be:

params[:business][:acceptinfo]

–  
Michael W.
