david
June 9, 2006, 1:55pm
1
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
david
June 9, 2006, 2:01pm
2
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/dan-webbs-request-routing-plugin
david
June 9, 2006, 2:01pm
3
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
david
June 9, 2006, 2:53pm
4
“David” [email protected] wrote in message
news:[email protected] …
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”