Skip to content

Instantly share code, notes, and snippets.

@Bill Bill/routes.rb
Created Sep 19, 2008

Embed
What would you like to do?
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
You can’t perform that action at this time.