[Catalyst] why is c.req.action missing leading slash?

Sebastian Riedel sri at oook.de
Sat Aug 13 20:17:58 CEST 2005


Am 13.08.2005 um 20:03 schrieb Phil Mitchell:

> Bug or feature? Or am I just completely confused?
>
> For an action such as '/page/edit', c.req.action holds 'page/edit' --
> I'm guessing that was done for a good reason, but it complicates my
> usage. Right now I'm abstracting all action names out of my view
> templates, so I have to worry about whether they have leading slash or
> not.

Don't use action, it won't work for regex, use c.req.match instead.
It has no leading slash cause c.req.base is guaranteed to have a  
slash as last char.

--
sebastian




More information about the Catalyst mailing list