Skip to content

Instantly share code, notes, and snippets.

@onlymejosh
Created July 2, 2010 12:37
Show Gist options
  • Save onlymejosh/461298 to your computer and use it in GitHub Desktop.
Save onlymejosh/461298 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.resources :users, :collection => {:login => :get, :logout => :get, :create => :get}
# The priority is based upon order of creation: first created -> highest priority.
map.resources :completed
map.resources :projects, :has_many => :presentations
map.resources :presentations, :has_one => :videos
map.resources :presentations, :has_one => :keynotes
map.resources :slides, :collection => { :times => :put}
# map.root :controller => "projects"
map.with_options :controller => 'contact' do |contact|
contact.contact '/contact',
:action => 'index',
:conditions => { :method => :get }
contact.contact '/contact',
:action => 'create',
:conditions => { :method => :post }
end
map.presentation '/:id/:title', :controller => 'presentations', :action => 'display'
map.presentation '/:id', :controller => 'presentations', :action => 'display'
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment