The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Dynamic VHosts One-liner for Rails

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Dynamic VHosts One-liner for Rails Posted: Jan 31, 2005 2:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Dynamic VHosts One-liner for Rails
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

So, how do Tada and Basecamp do dynamic virtual hosts to give each user their own subdomain? Drop this in ApplicationController:

 before_filter { |c| c.account =
   Account.find_by_subdomain(c.request.subdomains.first) }

Bravo. Requires a ServerName *.tadalist.com in the Apache VHost configuration and an accounts table with a subdomain field. (seen among #rubyonrails quotes.)

Read: Dynamic VHosts One-liner for Rails

Topic: Kapsules 0.9.8 Previous Topic   Next Topic Topic: 5.gets chromatic

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use