Skip to content

Instantly share code, notes, and snippets.

@phillipkregg
Created January 8, 2012 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phillipkregg/1580058 to your computer and use it in GitHub Desktop.
Save phillipkregg/1580058 to your computer and use it in GitHub Desktop.
Rake Routes - simple Books-Authors example
C:\Sites\knockout-books>rake routes
root /(.:format) {:controller=>"authors", :actio
n=>"index"}
author_books GET /authors/:author_id/books(.:format) {:action=>"index", :controller=
>"books"}
POST /authors/:author_id/books(.:format) {:action=>"create", :controller
=>"books"}
new_author_book GET /authors/:author_id/books/new(.:format) {:action=>"new", :controller=>"
books"}
edit_author_book GET /authors/:author_id/books/:id/edit(.:format) {:action=>"edit", :controller=>
"books"}
author_book GET /authors/:author_id/books/:id(.:format) {:action=>"show", :controller=>
"books"}
PUT /authors/:author_id/books/:id(.:format) {:action=>"update", :controller
=>"books"}
DELETE /authors/:author_id/books/:id(.:format) {:action=>"destroy", :controlle
r=>"books"}
authors GET /authors(.:format) {:action=>"index", :controller=
>"authors"}
POST /authors(.:format) {:action=>"create", :controller
=>"authors"}
new_author GET /authors/new(.:format) {:action=>"new", :controller=>"
authors"}
edit_author GET /authors/:id/edit(.:format) {:action=>"edit", :controller=>
"authors"}
author GET /authors/:id(.:format) {:action=>"show", :controller=>
"authors"}
PUT /authors/:id(.:format) {:action=>"update", :controller
=>"authors"}
DELETE /authors/:id(.:format) {:action=>"destroy", :controlle
r=>"authors"}
books GET /books(.:format) {:action=>"index", :controller=
>"books"}
POST /books(.:format) {:action=>"create", :controller
=>"books"}
new_book GET /books/new(.:format) {:action=>"new", :controller=>"
books"}
edit_book GET /books/:id/edit(.:format) {:action=>"edit", :controller=>
"books"}
book GET /books/:id(.:format) {:action=>"show", :controller=>
"books"}
PUT /books/:id(.:format) {:action=>"update", :controller
=>"books"}
DELETE /books/:id(.:format) {:action=>"destroy", :controlle
r=>"books"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment