As part of my project, I need to store IP address for every object
that was created.
Now all these records have the following attribute in their table
One way to do this is to put this code everywhere in the controllers:
user.ip_address_on_create = request.remote_ip ,… and so
Now to conform to DRY (don’t repeat yourself), I see the mechanism:
after_create (model) and after_filter ( controller). I am not
really sure how to tie this thing together. Would appreciate any tips
or Ruby-Fu .
Thanks in advance!