Is there any way to chain actions such that they can be endpoints or intermediate steps?

For example:

I want to have a REST controller that allows these URLs to work using ActionClass REST and Chained

http://myapp.com/car - dispatch to sub car_GET for list of cars

http://myapp.com/car/corvette - dispatch to car_GET for a single record

http://myapp.com/car/corvette/model - dispatch to sub model_GET chained to sub car{} for a list of corvette types

http://myapp.com/car/corvette/model/Z06 - dispatch to sub model_GET chained to sub car{} for a single corvette type record

something like this doesn't quite work:

sub car :ActionClass('REST') Chained CaptureArgs(1) {}
sub model :ActionClass('REST') Chained('car') Args(1) {}

So my question: Is there a Chained incantation to allow all of the following to be endpoints?

/car
/car/aCarID
/car/aCarID/model
/car/aCarID/model/aModelID

Or am I just DoingItWrong all together?

_______________________________________________
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/

Reply via email to