# Dealing with Form Data

**URL:** <https://www.ruby-forum.com/t/dealing-with-form-data/89336>\
**Category:** Rails\
**Created:** [March 28, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/dealing-with-form-data/89336 "2006-03-28T20:49:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 28, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/dealing-with-form-data/89336/1 "2006-03-28T20:49:55Z")

</div>

Google lets me down once again 🙂

Coming from a PHP background I know I can take submitted form data, mix  
it, mash it and put it together in very odd ways. In other words do  
this.

$title = “My Title”  
$sub\_title = “My Sub Title”  
$full\_title = $title . “-” . $sub\_table

And submit $full\_title to the database. I have yet to find a solution  
for this in Rails - I know there is one but being new to all this I am  
probably just missing it. Basically I want to take form data - mash it  
together and then submit it to the database.

Does this go in def create? If not where. Thanks.

AndrewM

---

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 28, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/dealing-with-form-data/89336/2 "2006-03-28T21:08:03Z")

</div>

Grab them while they are still params.

@record.full\_title = params[:title] + “-” + params[:sub\_title]

---

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 29, 2006, 3:14am UTC](https://www.ruby-forum.com/t/dealing-with-form-data/89336/3 "2006-03-29T03:14:03Z")

</div>

In the controller, take the form data directly into  
the model. Put the temporary data into non-DB backed  
attributes, then call a method to mix and mash the  
form data into the DB backed attributes.

–  
– Tom M.
