New on the blog: Routing Deep-Dive — Resources, Ne...
# wheels-dev
p
New on the blog: Routing Deep-Dive — Resources, Nested Callbacks, and Route Model Binding. <https://blog.wheels.dev/posts/routing-resources-model-binding/> What it covers: •
resources()
→ the 7 RESTful routes from one call (and why
update
is secretly TWO routes — PATCH and PUT) • Nested resources: the callback form auto-closes for you;
nested=true
makes YOU call
.end()
. Mix them and you add an extra end() that pops an empty scope stack and throws. • Route model binding —
binding=true
resolves
<http://params.post|params.post>
before your action runs and 404s a missing record, so the findByKey + not-found dance disappears • Convention vs explicit binding diverge on a missing model class (skip vs re-throw); a missing record always 404s • The traps: route order is load-bearing (wildcard LAST), and you can't name an action after a framework helper (
model
,
redirectTo
, the
is*
predicates) or it 404s Standalone how-to with a full worked
config/routes.cfm
. If you've ever shipped
/posts/999999
and gotten a stack trace instead of a 404, this is the post.