depot>rails depot
Generates lots of code. Now to setup the database open the database.yml file in
depot\config\
and correct it to match your database:
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: mysql
database: depot_development
user: userNam
password: pass
test:
adapter: mysql
database: depot_test
user: userNam
password: pass
production:
adapter: mysql
database: depot_production
user: userNam
password: pass
then make use of the rake tool, to create the databases:
rake db:create:all
then to make the product scaffolding do the following:
depot>ruby script/generate scaffold Product title:string description:text image_url:string
And now its possible to start the server (
ruby script/server
) and create a product. following this url:
http://localhost:3000/products
No comments:
Post a Comment