In my application there are multiple controllers/actions that can modify the same model. I need to log that an update was made and need to also log which action/controller initiated the request. Is is possible to do so in the after_update instead of within every action that makes an update?
I’m using Rails 2.3.8
In my application there are multiple controllers/actions that can modify the same model. I
Share
No,
after_updatebelongs to the model level, it does not have access to the controller.At least you can use
after_updateto write in the log : when you will want to see on which controller it happen, you can browse the log to find the controller on the lines above.