views:

36

answers:

2

Im about to turn in to my school library a project which was done on rails.. this project is to be stored in a cd so that the school can have a copy of all my work for future reference if anyone wants to.... I want a simple way for people to install my project.. right now, my app depends on several migrations I made throughout the development phase and also needs some data to work properly (minimally it needs a user and some categories)...

what would be the ideal way to get this done? Im thinking, is there a way that db:create can run all of the migrations and also insert some initial data? My plan is to create a simple readme.txt file where I can dictate the simple steps to get the app up and running. Please Help, any advice is appreciated.

thanks in advance.

+2  A: 

I think what you want is seed data, which can be thrown into your seeds.rb file, and loaded with rake db:seed

Check out the rails cast: http://railscasts.com/episodes/179-seed-data

Jamie Wong
+1  A: 

Seed data is one way to go as Jamie suggests, but it might be simpler just to get it like you want it, and just ship the sqlite db with it.

Preston Marshall
you are right.. right now I regret creating the app with mysql.. but thanks for the tip
NachoF
If you did your migrations right, it should be a piece of cake to switch to sqlite. Install the gem, change your database.yml file, and rake db:migrate. Then "seed" your data.
Preston Marshall