Forum: Ruby on Rails subdomain

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
140b42eacbb92368d80e1b01bbca9567?d=identicon&s=25 David (Guest)
on 2006-06-09 13:55
(Received via mailing list)
I know how to retrieve the current :controller and :action, but is there
a
variable available for me to retrieve the URL items such as:

subdomain.mydomain.com

I would like to be able to pull "subdomain" out of the URL.  Is this
possible with something built-in?

Thanks,
David
9976060bfb26220dd042340394d06b31?d=identicon&s=25 Mihael Konjevic (retro)
on 2006-06-09 14:01
David wrote:
> I would like to be able to pull "subdomain" out of the URL.  Is this
> possible with something built-in?

http://weblog.rubyonrails.org/articles/2006/05/22/...
455ac2a64d06dc8461f4d258d7f7e980?d=identicon&s=25 Michael Trier (Guest)
on 2006-06-09 14:01
(Received via mailing list)
You might want to look into acts_as_subdomainable :)   Just kidding,
but you might look into this plugin:

http://www.agilewebdevelopment.com/plugins/account_location

It probably has the goods to get you going.

Michael
Ddd11872984864786c14992b99ab4d2d?d=identicon&s=25 Alan Bullock (Guest)
on 2006-06-09 14:53
(Received via mailing list)
"David" <lists@codecharter.com> wrote in message
news:3390.82.215.73.178.1149853974.squirrel@www.codecharter.com...
I know how to retrieve the current :controller and :action, but is there
a
variable available for me to retrieve the URL items such as:

subdomain.mydomain.com

@request.subdomains will give you an array of all the subdomains. In the
example you gave, @request.subdomains.first would return "subdomain"
This topic is locked and can not be replied to.