Forum: Ruby on Rails How to clone model's data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F8f5e304a0d18d4c5bf92b5d4a6928e2?d=identicon&s=25 Nuugii Lk (nuugii)
on 2008-11-25 06:14
Hey' guys.

How to clone model's data.
328f0bb678423fcea01ebe3b0edc74e6?d=identicon&s=25 Ben Johnson (benjohnson)
on 2008-11-25 06:49
Nurzed Lkham wrote:
> Hey' guys.
>
> How to clone model's data.

Try some things out in your console, that would the best way to get your
answer. Try:

@obj.clone

@obj.dup

@obj.attributes


It really depends on what you are using the data for.
This topic is locked and can not be replied to.