[Catalyst] Chained actions with can't terminate with :PathPart('') ?

Evan Carroll lists at evancarroll.com
Fri May 7 17:12:18 GMT 2010

I have two destinations in my Catalyst app


This works and is often seen in Catalyst apps to achive this effect.
sub lot :Chained('/auth/company') :CaptureArgs(1) {
sub view_lot :Chained('/auth/company') :PathPart('') :Args(1) {

However, I would also expect the below to work; but, it seems it doesn't. I
can only formulate the effect I want the above way. This is
unfortunate because if all chained descendants of `lot` utilize a
check provided here in the chain, then shouldn't `view_lot` also get
to utilize that code? It would certainly be nice to eliminate
redundant code here.
sub lot :Chained('/auth/company') :CaptureArgs(1) {
sub view_lot :Chained('/auth/company/lot') :PathPart('') :Args(0) {

I think it is also confusing to those that first encounter it.

I always know that I could just call it /view, and be done with it, but still.
/auth/company/5/lot/5/view rather than, /auth/company/5/lot/5

But, I just wanted to know what others thought of this.

Evan Carroll
System Lord of the Internets

More information about the Catalyst mailing list