# Defaults, on-site-text, other static data in rails

**URL:** <https://www.ruby-forum.com/t/defaults-on-site-text-other-static-data-in-rails/175463>\
**Category:** Rails\
**Created:** [September 14, 2009, 11:00am UTC](https://www.ruby-forum.com/t/defaults-on-site-text-other-static-data-in-rails/175463 "2009-09-14T11:00:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paerez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@paerez](https://www.ruby-forum.com/u/paerez)\
**Post date:** [September 14, 2009, 11:00am UTC](https://www.ruby-forum.com/t/defaults-on-site-text-other-static-data-in-rails/175463/1 "2009-09-14T11:00:44Z")

</div>

Rails theory question:

What is the best way to store “static” values? I.e., the default  
preferences for new users, or strings found throughout a site (all text  
displayed to the end user is in a DB so that languages are easy to add).

Currently this stuff is in the DB, default preferences being a “special”  
user (id: -1), and site text is in a big ole’ db table of its own.

This seems like it might be a bad solution and it definitely leads to 2  
problems:

First: Its slow. Every time any page loads all the text being pulled  
out of a db is way too slow, as I’m making the app I’m currently working  
on mostly to learn my way around rails, and its only in use by ~20  
people this is no problem, but it seems not scalable.

Second: I do not know the “right way” to bring this data to a new place  
when the server changes (which it does not too infrequently since its  
internal). I have a giant migration file full of data to add to these  
tables, but there’s gotta be a better way right?

Theory: It seems like the right solution to the first problem here  
might just be to make rails pull this “static” information out of the DB  
and into an object or a yaml file when it starts, is that correct? Is  
that possible? Is there a way easy and way railsy way to do it?

The second problem also seems like it has an easy solution, there must  
be a simple way to migrate and rebuild the data that is not  
user-specific when hopping moving a rails app, what is the correct way  
to do that? I.e. all the text displayed to the end user, I currently  
just move that whole table as sql, but that seems awfully non-rails.
