# Is there an easy way to move data from one table and copy it

**URL:** <https://www.ruby-forum.com/t/is-there-an-easy-way-to-move-data-from-one-table-and-copy-it/100208>\
**Category:** Rails\
**Created:** [July 27, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/is-there-an-easy-way-to-move-data-from-one-table-and-copy-it/100208 "2006-07-27T19:38:28Z")\
**Posts on this page:** 3\
**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:** [July 27, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/is-there-an-easy-way-to-move-data-from-one-table-and-copy-it/100208/1 "2006-07-27T19:38:28Z")

</div>

to another?

i would like my website to be able to have the user to fill out a web  
form. i then would like to have a view of my own to either accept or  
reject what the user filled out. if i accept it, i want the info deleted  
from where it was stored and then store it to the ‘public’ database.

i guess its all of a matter of saving each field in the form to a temp  
table. when i select the “accept” button, just create a hash that maps  
all the fields for the user and update the “public” table and then  
delete the user info in the temp table.

---

<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:** [July 27, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/is-there-an-easy-way-to-move-data-from-one-table-and-copy-it/100208/2 "2006-07-27T20:22:10Z")

</div>

bbqTree wrote:

> to another?
> 
> i would like my website to be able to have the user to fill out a web  
> form. i then would like to have a view of my own to either accept or  
> reject what the user filled out. if i accept it, i want the info deleted  
> from where it was stored and then store it to the ‘public’ database.
> 
> i guess its all of a matter of saving each field in the form to a temp  
> table. when i select the “accept” button, just create a hash that maps  
> all the fields for the user and update the “public” table and then  
> delete the user info in the temp table.

The way I thought about doing this was to have an “approved” field in  
the database. This flag defaults to zero. The admin views the  
submission, and changes the approved flag to 1 . The view would only  
show the submission if the approval flag is set to 1 . In this way,  
there is no need to copy data around .

Let me know if this makes sense, as I need to implement something  
similar myself soon.

Chris

---

<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:** [July 27, 2006, 8:56pm UTC](https://www.ruby-forum.com/t/is-there-an-easy-way-to-move-data-from-one-table-and-copy-it/100208/3 "2006-07-27T20:56:59Z")

</div>

hmm, that sounds like a good idea. instead of 0 for not approved and 1  
for approved, make the “yet to be approved” field to -1. during non-peak  
hours, delete all the 0’s that been disapproved.

Chris L. wrote:

> bbqTree wrote:
> 
> > to another?
> > 
> > i would like my website to be able to have the user to fill out a web  
> > form. i then would like to have a view of my own to either accept or  
> > reject what the user filled out. if i accept it, i want the info deleted  
> > from where it was stored and then store it to the ‘public’ database.
> > 
> > i guess its all of a matter of saving each field in the form to a temp  
> > table. when i select the “accept” button, just create a hash that maps  
> > all the fields for the user and update the “public” table and then  
> > delete the user info in the temp table.
> 
> The way I thought about doing this was to have an “approved” field in  
> the database. This flag defaults to zero. The admin views the  
> submission, and changes the approved flag to 1 . The view would only  
> show the submission if the approval flag is set to 1 . In this way,  
> there is no need to copy data around .
> 
> Let me know if this makes sense, as I need to implement something  
> similar myself soon.
> 
> Chris
