0

I want to collect info about the visitor - like IP-number, referer, agent etc. I assume this is possible with Ruby on Rails (e.g. request.referer), but I cannot find the documentation for this.

Is there any documentation that lists everything that I can log about visits to my app?

Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232

1 Answers1

1

Is this what you're looking for?

EDIT:

So, yeah, in the above link you get some methods for accessing the headers.

You can also access the referrer using the method you said, or with request.env['HTTP_REFERER']. Some more information here:

Rails 3 get request referrer

How to get request referer path?

As for the agent, I made a little research, since I never used, and it seems you can access it with request.env['HTTP_USER_AGENT']. It seems there's also a gem avaliable for the task.

Please let me know if these work out for you =]

Community
  • 1
  • 1