User action log

Hi all,
I had been searching and reading for user action logging in Rails 3 and
didn’t came out with something that looks like the way to take for sure.
Does anyone know a gem or have any recommendation about the best way to
do
this?

The idea is to log the user, date and time information, the controller
and
action in almost all the actions.

Thanks.

you can do it by yourself… just create before_filter, place into your
application controller and store controller_name and action or any other
values

assume you have some db table with user logging

class ApplicationController < ActionController::Base

before_filter :log_user

private

def log_user
UserLog.create(
:user => current_user,
:controller_name = controller_name,
:action => action_name
)
end

end

you can store your params as well (eg. serialize into YAML)

tom

On May 20, 2011, at 17:57 , Piter F. wrote:

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

Thanks Tom, thats the approach I had in mind but didn’t know for sure if
there was already something or if it was a good way to go.

Will follow your indications.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs