Skip to content

Instantly share code, notes, and snippets.

@porras
Created July 4, 2009 13:20
Show Gist options
  • Save porras/140579 to your computer and use it in GitHub Desktop.
Save porras/140579 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.root :controller => 'posts'
end
$ rake routes
root / {:controller=>"posts", :action=>"index"}
ActionController::Routing::Routes.draw do |map|
map.resources :posts, :as => ''
end
$ rake routes
(in /Users/sergio/routes)
posts GET /(.:format) {:controller=>"posts", :action=>"index"}
POST /(.:format) {:controller=>"posts", :action=>"create"}
new_post GET //new(.:format) {:controller=>"posts", :action=>"new"}
edit_post GET //:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
post GET //:id(.:format) {:controller=>"posts", :action=>"show"}
PUT //:id(.:format) {:controller=>"posts", :action=>"update"}
DELETE //:id(.:format) {:controller=>"posts", :action=>"destroy"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment