Flowdock
v2.0.0 - Show latest stable - 2 notes - Superclass: Object

CgiRequest and TestRequest provide concrete implementations.

Constants

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’ }.

Show files where this class is defined (1 file)
Register or log in to add new notes.
July 30, 2008
6 thanks

Different Method for Subdomains

@james

You can also access the subdomain via the subdomains array.

request.subdomains.first
July 23, 2008 - (v1.0.0 - v2.1.0)
2 thanks

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('.')