Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
r.match("/admin") do |a| a.match("/spoons").resources.to(:controller => "spoons") a.match("/:spoon_id") do |b| b.match("/forks").resources.to(:controller => "forks") b.match("/:fork_id") do |c| c.match("/keyboards").resources.to(:controller => "keyboards") end end # More interesting now. We can get flexible with resource routes: # Here's one that assumes all admin routes are resources: # e.g. GET /admin/things/1 would be mapped to Admin::Things#show, params = {:id => 1} a.match_resources("/admin/:controller").to(:controller => "admin/:controller") end
This paste will be private.
From the Design Piracy series on my blog: