Question


#1

Hello all!
I would like to get an admin interface for my shopping cart app
up and running using rails. The admin interface will be used for
Customers, Products, Catggories, ect management. My db schema reflects
the above mention tables names. The question I have is could I use the
scaffold feature this way:

(eg)—ruby script/generate scaffold Products Customers Categories
Admin?


#2

Hi, Patrick,

you should make sure that your database scheme uses the other
conventions
that rails assumes. If it does not do a search on the wiki for legacy
schema
and build your models upon that.

The main other convention that your legacy schema often won’t fit is the
name of the foreign keys which should be in your case customer_id,
product_id and category_id. But you could of course use scaffolding to
make
up some stumps and then define your associations as told in the wiki
page
regarding legacy schemas. Just give scaffolding a try and see if it
gives
you errors…

Best Regards
Jan P.