I’m a newbie at Rails and Ruby so please bear with me:
I’m trying to build a simple application that has an administration
system that manages organizations and products. I want the model/views/
controllers for ‘organizations’ and ‘products’ to be within the
‘admin’ part of the site, so I created a controller for admin first:
generate controller admin
then I created scaffolding like thus:
generate scaffold admin/organization
generate scaffold admin/product
everything seems fine so far, the tables created through the migration
were admin_organizations and admin_products which is fine, until I try
to access the index view for either organizations or products, at
which point I get the error:
Table ‘wyforg_development.products’ doesn’t exist: SELECT * FROM
products
which makes sense since the table is called ‘admin_products’ not
‘products’. I assume the way to address this is not to rename the
tables ‘products’ and ‘organizations’, dropping the ‘admin_’ prefix,
but by some other method of overriding the default configuration of
the scaffolding, but I can’t figure out where to do this and how.
Thanks for any help.
~Ben