# Model data templates

**URL:** <https://www.ruby-forum.com/t/model-data-templates/116767>\
**Category:** Rails\
**Created:** [October 9, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/model-data-templates/116767 "2007-10-09T16:37:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![linojon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b3f665/32.png) [@linojon](https://www.ruby-forum.com/u/linojon)\
**Post date:** [October 9, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/model-data-templates/116767/1 "2007-10-09T16:37:52Z")

</div>

hi,

i’m looking for suggestions how to setup and manage relatively small  
default data sets to be used as templates.

lets say a user can have a default set of objects involving several  
models, and there might be several default sets to pick from  
(template objects).

Would you suggest I create the ‘templates’ in the db as specially  
named records, and copy them to the user, or create a method that  
just makes a series of create calls, or use an external file like  
yaml, or use xml, etc… ??

One approach I’m thinking of creating the sets of objects in the db  
via a data migration via yml files, and then cloning them from the db  
when the user picks one, but that means the templates would be spread  
across multiple yml files, one for each model. I’d prefer to keep  
them together.

linoj
