Forum: Ruby on Rails question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1744718eb0f1f4c8ec88d8560ad2409c?d=identicon&s=25 Lurlay, Patrick (Guest)
on 2006-03-01 17: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
Admin?
E48d29dc8fedb2878fa518d41cc63d88?d=identicon&s=25 Jan Prill (Guest)
on 2006-03-02 10:22
(Received via mailing list)
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 Prill
This topic is locked and can not be replied to.