Skip to content

Instantly share code, notes, and snippets.

@derrickreimer
derrickreimer / rake routes
Created June 30, 2011 18:36
Document resource route with the option of scoping by version
GET /documents/:id(/:version)(.:format) {:action=>"show", :controller=>"documents"}
GET /documents/:id(/:version)/edit(.:format) {:action=>"edit", :controller=>"documents"}
PUT /documents/:id(/:version)(.:format) {:action=>"update", :controller=>"documents"}
DELETE /documents/:id(/:version)(.:format) {:action=>"destroy", :controller=>"documents"}
GET /documents/:document_id(/:version)/sections(.:format) {:action=>"index", :controller=>"sections"}
POST /documents/:document_id(/:version)/sections(.:format) {:action=>"create", :controller=>"sections"}
GET /documents/:document_id(/:version)/sections/new(.:format) {:action=>"new", :controller=>"sections"}
GET /documents/:document_id(/:version)/sections/:id/edit(.:format) {:action=>"edit", :controller=>"sections"}
GET /documents/:document_id(/:version)/sections/:id(.:format) {:action=>"show", :controller=>"section