I'd like to do the following:
define a before_filter
in application.rb
that extracts the user's IP address and stores it anywhere, preferably in the session.
define two before filters in all my models as before_create and before_update that add the current user's IP to the object to be stored.
Problem: I cannot access session[]
neither env[]
in a model. Can anyone help with a standard solution that I don't know yet?
Regards Jason