Support for dynamic subdomains
I want an easy way to achieve the sort of dynamic subdomains you see on blogspot and even basecamp. I know there are ways to do it via plugins and such, but I'd like it to be significantly easier than it is now.
5 comments
-
Vikrant Chaudhary
commented
While Basecamp/Blogspot style subdomains are easy. Rails 3 should support dynamic subdomains out-of-the-box, where some controllers belong _only_ to "www ", some to "help.", some to /^[a-z]{2,}\.wiki/ (like en.wiki.example.org) and some to /^[a-z0-9]+\.user/. it's more like dynamic subdomains in Wordpress/Livejournal than in Basecamp/Blogspot.
And of course, not forgetting, link_to("Help", root_url(:subdomain => 'help')).
- just some raw imaginations.
-
Mark
commented
I think this request is also about keeping the Rail's named_route helper methods in the views and controllers.
It would be great if the view and controller code didn't need to change, and we were able to turn subdomains on and off easily in routes or environment configuration files. Someone may want to run development without subdomains and production with them.
-
carpeliam
commented
This isn't that hard in rails now as dhh has said, but i think merb gets this right, it belongs in the router.
-
dhh
commented
It's already very easy to have Basecamp style dynamic subdomains in Rails. Just point *.example.com at your Rails application and use a before filter ala http://gist.github.com/44400.
-
wycats
commented
This is currently available in the Merb router, which is being ported to Rails. Glad to see interest in this. (merb's router supports routing by any element of Request)