Static selection and Ruby on Rails objects
- by Dave
Hi all-
I have a simple problem, but am having trouble wrapping my head around it. I have an video object that should have one or more "genres". This list of genres should be prepopulated and then the user should just select one or more using autocomplete or some such. Here is the question:
Is it worth creating a table with genres for the static selection? Or should it just be included in the presentation layer? If there is a static table, how do we name it correctly. I envision something like this
class Video < ActiveRecord::Base
has_many :genres
...
end
class Genre < ...
belongs_to :video
...
end
But then we get a table called genre, that basically maps all the selected genres to their parent videos. There would need to be some static table to reference the static genres. Is this the best way to do it?
Sorry if this was rambl-y a little stream of conciousness. Thanks!