# How/where to load initial data?

**URL:** <https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929>\
**Category:** Rails\
**Created:** [September 4, 2009, 10:00am UTC](https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929 "2009-09-04T10:00:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [September 4, 2009, 10:00am UTC](https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929/1 "2009-09-04T10:00:53Z")

</div>

Hello,

I’ve got a got a question about how and where to load initial data that  
is necessary in order to make the website work (menu structure, page  
contents, …)

I know it’s preference and everybody can do it as s/he wants but I just  
wanna know if there’s any convention or something like that.

First of all, how do I normally load necessary data as mentioned above?  
Put it in a fixture and load it while migrating or type it directly into  
the migration?

Secondly what about data that is not needed to run the make the  
application work but makes my life easier (e.g. a user account so I  
don’t have to register myself each time after resetting the migrations)?

Thanks,  
Hans

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [September 4, 2009, 11:23am UTC](https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929/2 "2009-09-04T11:23:13Z")

</div>

Another question about where it is supposed to be located  
conventionally: Where should I put translations? I found many different  
locations on the net…

lib/locale?  
lib/locales?  
config/locale?  
config/locales?

I just wanna stick to the “convention over configuration” thing, that’s  
why I’m asking. Is there any website that has alle these convention  
information by the way?

Thanks

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [September 4, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929/3 "2009-09-04T14:34:02Z")

</div>

Heinz S. wrote:

> Hello,
> 
> I’ve got a got a question about how and where to load initial data that  
> is necessary in order to make the website work (menu structure, page  
> contents, …)
> 
> I know it’s preference and everybody can do it as s/he wants but I just  
> wanna know if there’s any convention or something like that.
> 
> First of all, how do I normally load necessary data as mentioned above?  
> Put it in a fixture and load it while migrating or type it directly into  
> the migration?

Data does not belong in migrations, and fixtures aren’t great for this  
either. I would advise loading it from a separate file. The Seed-Fu  
plugin might be helpful.

> Secondly what about data that is not needed to run the make the  
> application work but makes my life easier (e.g. a user account so I  
> don’t have to register myself each time after resetting the migrations)?

Same answer, I suppose.

> Thanks,  
> Hans

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [September 4, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/how-where-to-load-initial-data/174929/4 "2009-09-04T14:47:19Z")

</div>

Thanks, I’ll have a look at that plugin!
