how to copy all the data of a table to a new table in rails
**I m using MySQL**
i have one x table n corresponding mvc and y table n corresponding model only. when I select a destroy in x's view, it should fulfill two tasks. Firstly, destroy the id from x table and save all the data starting from id.... to y's table
Please guide me what relationship I should make and how to do it.
I tried lot of coding related to it but I m failed, reason being lack of deep knowledge of ruby on rails..
Please help
how to copy all the data of a table to a new table in rails
===

**I m using MySQL**
i have one x table n corresponding mvc and y table n corresponding model only. when I select a destroy in x's view, it should fulfill two tasks. Firstly, destroy the id from x table and save all the data starting from id.... to y's table
Please guide me what relationship I should make and how to do it.
I tried lot of coding related to it but I m failed, reason being lack of deep knowledge of ruby on rails..
Please help