Store limited list in db?


I’m currently developing an application which contains a Movie object.
I was wondering what the best way to store a limited list such as
mpaa_rating would be? The list is not likely to expand often, so i was
wondering if it was still best to store this list in a table? Or if
there was something else like acts_as_state_machine for maintaining a
simple list like this.


You could store the rating as a constant in your config/environment.rb

MPAA_RATINGS = [“Rating #1”,“Rating #2”]

And then just do a select in your form:

<%= “rating”, MPAA_RATINGS %>

On Dec 31, 2007 11:59 AM, Adam W.
[email protected]


Posted via

Ryan B.
Feel free to add me to MSN and/or GTalk as this email.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs