ruby on rails - For one of my models, I have a few instances that should be auto-populated. How do I handle this? -


I should be specific to understand that in my application I am called a model that contains widget color information Provide themes, but primarily rely on users to create their own themes. So the question is where do I store my subjects? If I store them in a theme database, whenever I switch the database or flush during the trial, I will have to re-enter topics. This is not a big deal, it just looks sloppy.

I have the content stored in hash in the controller right now. There is a problem with each widget, Theme_ID in each widget, and there is no theme_id for the topics provided to us because they are not stored in the database Are there.

I know that its solution issue is very simple, but I want to make sure my solution employs best coding practices. Does anyone have any suggestions for this? Perhaps there is a way to add entries to the database during migration or other rake work ...

Thanks!

Tony

Loads of seed data in the migration is most understandable and There is something that I have done often if you first make some records, then in fact your table is the correct initial part, i.e. if your desk will only do the necessary job in your application, then they are in migration. Rake works are great for capturing data sets, which you need to load in the application on command (for example, for demo), but if some records are going to be continually needed, then the migration space is


Comments