I would just use the request.remote_ip
that’s simple and it works. Any reason you need another method?
See: Get real IP address in local Rails development environment
for some other things you can do with client server ip’s.
More Related Contents:
- Explain like I'm LITERALLY five…what does it mean to "format" a string? [closed]
- Convert string to XXX
- Understanding the Rails Authenticity Token
- What is the best method of handling currency/money?
- form_for with nested resources
- Why do routes with a dot in a parameter fail to match?
- Installing Bootstrap 3 on Rails App
- Rails 4 Authenticity Token
- When to use a “has_many :through” relation in Rails?
- usage of attr_accessor in Rails
- Change from SQLite to PostgreSQL in a fresh Rails project
- ActiveRecord Find By Year, Day or Month on a Date field
- Getting the warning “Insecure world writable dir /home/chance ” in PATH, mode 040777 for rails and gem
- How does Rails ActiveRecord chain “where” clauses without multiple queries?
- How to test for (ActiveRecord) object equality
- Connecting to multiple databases in ruby on rails
- How do I wrap link_to around some html ruby code?
- How to match accented characters with a regex?
- ‘require’: cannot load such file — ‘nokogiri\nokogiri’ (LoadError) when running `rails server`
- What are the brackets [5.1] after ActiveRecord Migration and how does it work? [duplicate]
- f.error_messages in Rails 3.0
- Scope with join on :has_many :through association
- Rails Migrations: tried to change the type of column from string to integer
- Adding extra registration fields with Devise
- Rails 4 – checkboxes for has_and_belongs_to_many association
- Rails 4: Why are fonts not loading in production?
- String.force_encoding() in Ruby 1.8.7 (or Rails 2.x)
- Error message: Make sure that `gem install pg -v ‘0.18.1’` succeeds before bundling
- Rails 4.0 expire_fragment/cache expiration not working
- How to skip a before_filter for Devise’s SessionsController?