Logging stuff


#1

Say I wanted to log all successful and failed saves to a special log
table. But I also wanted to save the logged in user and some other
session stuff.
I assume I would have some sort of module included into the controllers,
which would then do something with the methods of the objects being
manipulated, but I’m not sure what the best approach is. I’ve tried a
few variations of alias_method, but I’m struggling to get the
information from the controller across to the context of the model.
Does the answer involve binding perhaps?


#2

Use acts_as_audited.


#3

Say I wanted to log all successful and failed saves to a special log
table. But I also wanted to save the logged in user and some other
session stuff.
I assume I would have some sort of module included into the
controllers,
which would then do something with the methods of the objects being
manipulated, but I’m not sure what the best approach is. I’ve tried a
few variations of alias_method, but I’m struggling to get the
information from the controller across to the context of the model.
Does the answer involve binding perhaps?

This is what I did on a recent project…

http://pjkh.com/articles/2009/02/02/creating-an-audit-log-in-rails

-philip