- 1.0.0 (0)
- 1.1.0 (0)
- 1.1.1 (0)
- 1.1.6 (30)
- 1.2.0 (0)
- 1.2.6 (0)
- 2.0.0 (-38)
- 2.0.1 (0)
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.2
- 2.3.8
- 3.0.0
- 3.0.5
- 3.0.7
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.3
- 3.2.8
- 3.2.13
- What's this?
CgiRequest and TestRequest provide concrete implementations.
Constants
TRUSTED_PROXIES = /^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i
MULTIPART_BOUNDARY = %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|n
EOL = "\015\012"
Attributes
| [R] | env | The hash of environment variables for this request, such as { ‘RAILS_ENV’ => ‘production’ }. |
Different Method for Subdomains
@james
You can also access the subdomain via the subdomains array.
request.subdomains.first
subdomains from request
Useful for discovering what domain/subdomain(s) the current request came from (Rails application may operate differently depending on which subdomain is passed in, this is a great way to segment functionality using the route).
request.host.split('.')
Doesn’t get much simpler than that :).
Likewise if you want to see only the subdomain component(s). Given a domain, example.com
request.host.gsub('example.com', '').split('.')


