Our app has two user models, User and Admin, each with their own non-
Users have a reasonably simple crud page, let’s call it “foods”, and
we want to add “foods template” functionality to the admin ui.
Basically reusing the food model, but with a blank user_id FK, as
default data for new users.
What is the best way to go about this and not duplicate model,
controllers and views…?
We’ve considered extracting common controller code into a module and
mixing that into two separate controllers, but would still have to
duplicate the views for that – or at least sprinkle them with
permission checks for every link.
Using a single controller/view sprinkled with “mode” checks doesn’t
feel right either, but could work with some work on our authorization
Any other suggestions?