Just started playing around with RoR/scaffolding and have been
impressed so far. However, it seems to create a 1:1 relationship
between Controllers and Models and the basic CRUD actions – I need to
CRUD two models from the same views and actions.
Book controller, with create/edit/show/destroy/list actions and the
Category controller, with create/edit/show/destroy/list actions and
the scaffold-gen’ed views.
I’d like to have:
Admin Controller, with create/edit/show/destroy/list actions for both
I want to essentially combine the Controllers and views into one so
that when you create/edit/show/destroy a Category you can also create
the Books from the same views/actions.
I’ve added the appropriate belongs_to and has_many relationships to
each model (and the table pk/fks are in place):