hi, how to create a subdomain outside the public directory and how to redirect to the subdomain -- Posted via http://www.ruby-forum.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 I would like to be able to pull "subdomain" out of the URL. Is this possible with something built-in? Thanks, David
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 On 6/9/06, David <lists@codecharter.com> wrote:> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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 -- Posted via http://www.ruby-forum.com/.
"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"