# Gain value from form

**URL:** <https://www.ruby-forum.com/t/gain-value-from-form/60134>\
**Category:** Rails\
**Created:** [May 10, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/gain-value-from-form/60134 "2006-05-10T16:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssssss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@ssssss](https://www.ruby-forum.com/u/ssssss)\
**Post date:** [May 10, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/gain-value-from-form/60134/1 "2006-05-10T16:52:17Z")

</div>

I have the following form

\<%= start\_form\_tag :action =\> ‘rejectQuoteSave’, :id =\> @project %\>

\* Reason  
\<%= text\_area 'offer', 'reason\_rejected' %\>

\<%= submit\_tag ‘Update’ %\>  
\<%= end\_form\_tag %\>

How can I gain the value of the text field in projects\_controller.rb and  
then save it to another table by doing somthing like

```
@project = Project.find(params[:id])

@offer = Offer.find(@project.offer_id)

@offer.date_rejected = Time.now

#########get value here###########
@offer.reason_rejected =

@offer.save
```

---

<div class="post-metadata">

**Author:** ![ssssss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@ssssss](https://www.ruby-forum.com/u/ssssss)\
**Post date:** [May 10, 2006, 10:54pm UTC](https://www.ruby-forum.com/t/gain-value-from-form/60134/2 "2006-05-10T22:54:39Z")

</div>

On 5/10/06, ss [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> @offer.reason_rejected =
> 
> @offer.save
> 
> ```

I’m a bit tired, so this might be wrong, but since you got no reply  
yet I figured I’d suggest it anyway so you could try it at least.

params[‘offer’][‘reason\_rejected’]

That should hold the data for you.

Hope that helps.  
Mathias.

---

<div class="post-metadata">

**Author:** ![ssssss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8dc957/32.png) [@ssssss](https://www.ruby-forum.com/u/ssssss)\
**Post date:** [May 11, 2006, 10:16am UTC](https://www.ruby-forum.com/t/gain-value-from-form/60134/3 "2006-05-11T10:16:44Z")

</div>

Mathias W. wrote:

> On 5/10/06, ss [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > ```
> > @offer.reason_rejected =
> > 
> > @offer.save
> > 
> > ```
> 
> I’m a bit tired, so this might be wrong, but since you got no reply  
> yet I figured I’d suggest it anyway so you could try it at least.
> 
> params[‘offer’][‘reason\_rejected’]
> 
> That should hold the data for you.
> 
> Hope that helps.  
> Mathias.

Yeah that worked,

Thanks
