Ruby on Rails – Get the IP and Browser of a user
If you need to get the IP of a user, you can simply use request.remote.ip
ip = request.remote_ip
If you need to get the user browser, you can use the following
user_browser = request.env[‘HTTP_USER_AGENT’]
Of course, the results would be stored in ip and user_browser respectively.
- Capturing failed logins when using adauth
- Date Pickers in Rails (Internet Explorer and other browsers)
- Viewing your SQLLite Data (Ruby on Rails beginners)
- Setting browser caching
- Google Plus location sharing wasn’t working on an android.
- Rails – What to do check your date searches are not showing the results you expect.
- A neat tool to check the browser/environment.
- Ruby on Rails – Show a field only if the controller is ‘new’