catalyst  

Re: [Catalyst] Default running over chained

Tomas Doran
Thu, 28 Jan 2010 01:36:22 -0800


On 26 Jan 2010, at 22:13, xenoterrac...@gmail.com wrote:

I added a default action to my user controller. When I access /user/ a chained action is supposed to run, and it ran just fine until i added the default action. Now the default runs instead of the chained. No index exists in the controller

sub base :Chained('/') : PathPrefix : CaptureArgs(0) { ... }

sub list : Chained('base') : PathPart('') : Args(0) { ... }

sub default : Path { ... }


Hmm, not sure if this i a bug or not as it's into ordering (which gets priority Path or Chained as they're both asking for the same URI).

If you actually want the magic fallback of 'default', you want sub :default : Private

Or why not try sub default : Chained('base') PathPart('') Args() {...} # Which should catch anything 'sub list' or other actions don't as it accepts any number of args..

Cheers
t0m

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/