Skip to content

Instantly share code, notes, and snippets.

@Bill
Created September 19, 2008 22:52
Show Gist options
  • Save Bill/11683 to your computer and use it in GitHub Desktop.
Save Bill/11683 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.with_options :conditions => { :host => /^blog\.foo.com$/} do | blog |
blog.connect '', :controller => 'blog', :action => 'index', :conditions => {:method => :get}
blog.connect '/post/:id', :controller=>'post', :action=>'show', :conditions => {:method => :get}
... more blog stuff
end
map.with_options :conditions => { :host => /^foo.com$/} do | foo |
foo.connect '', :controller => 'foo_home', :action => 'index', :conditions => {:method => :get}
foo.connect 'why', :controller => 'foo_about', :action => 'index', :conditions => {:method => :get}
foo.contact 'contact', :controller => 'foo_contact', :action => 'index', :conditions => {:method => :get}
... more corporate site stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment