That's awesome. I put that code into my application.rb file and it seems to work great!
In addition, I am looking to a couple of other subdomains not attached to accounts (ie- admin.domain.com). I installed the request_routing plugin and it seems to work great. It gives me some good options within the routes.rb file that allow me to direct the root of the application to different controllers based on the subdomains. Like this: map.root :controller => 'public_home', :action => 'index', :conditions => { :subdomain => '' } map.root :controller => 'public_home', :action => 'index', :conditions => { :subdomain => 'www' } map.root :controller => 'system', :action => 'index', :conditions => { :subdomain => 'admin' } map.root :controller => 'account_home', :action => 'index', :conditions => { :subdomain => /.+/ } This seems to work great with Rails 2.2. On Dec 3, 12:19 pm, Andrew Bloom <[EMAIL PROTECTED]> wrote: > The code to configure this is fairly trivial, try something like this > in the controller(s) you need subdomain access. > > before_filter :load_account > def load_account > @account = Account.find(:first, :conditions => ["slug = ?", > request.subdomains.first]) > raise ActiveRecord::RecordNotFound unless @account > end > > On Dec 3, 10:16 am, Perry D <[EMAIL PROTECTED]> wrote: > > > I'm pretty new here, but if anybody had ideas on how to go about using > > subdomains for accounts within Rails 2.2. I had seen the subdomain-fu > > plugin, but it didn't look like it plays very well with 2.2. Anyone > > know of other plugins that might be useful? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---