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

Ram Dobson ram.dobson at nih.gov
Fri May 7 18:23:11 GMT 2010

it seems to me that you have companies that have lots.

something like this:

sub company :Chained('/auth') :CaptureArgs(1) { ... }

sub lot :Chained('company') :Args(0) { ... }
sub view_lot :Chained('lot') PathPart('') :Args(1) { ... }

would suffice, perhaps?

On 5/7/2010 1:12 PM, Evan Carroll wrote:
> I have two destinations in my Catalyst app
> /auth/company/5/lot
> /auth/company/5/lot/5
> 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.

More information about the Catalyst mailing list