Forum: Ruby on Rails question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Lurlay, Patrick (Guest)
on 2006-03-01 18:38
(Received via mailing list)
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
Jan P. (Guest)
on 2006-03-02 11:22
(Received via mailing list)
Hi, Patrick,

you should make sure that your database scheme uses the other
that rails assumes. If it does not do a search on the wiki for legacy
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
up some stumps and then define your associations as told in the wiki
regarding legacy schemas. Just give scaffolding a try and see if it
you errors...

Best Regards
Jan P.
This topic is locked and can not be replied to.