I have a basic model called Page and have many STI models based on Page such as
I have separate controller and view for each of these STI models because I needed to customized the view layer based on the model type and have different logic for controller and hence separate controllers. However, I need the author field of all models to be set to current user. How do I do this in a single place?
For example, if I use before_action on Page controller and set the author, it affects the @page instance variable whereas my DrawingsController is using @drawing so it wont save the author of my @drawing unless I repeat the same code in DrawingsController.