Cakephp routing: prefixes and forms

Prefixes are a nice way to define routes for groups of actions, (see the cookbook).
All admin_ actions go with the /admin// url
For my project i needed both an admin route and a dashboard route, so i made prefixes for them like:
(/app/config/routes.php)
Router::connect('/dashboard/:controller/:action/*', array('prefix' => 'dashboard'));
Now in the view you can use the following:
echo $html->link('Profile', array('controller'=>'users', 'action'=>'dashboard_profile'), array('title'=>'Edit profile'))
But when it comes to forms things start to break.
For example the following:
echo $form->create('User', array('action'=>'dashboard_profile'));
or this one:
echo $form->create('User', array('url'=>array('controller'=>'users', 'action'=>'dashboard_edit')));
generate the following (wrong) link: /users/dashboard_profile/1
While it does point to the right action (dashboard_profile) you get an error message explaining that this is a private action. The only way to use this private action is to use the prefix method.
The reason for this is that the form generate part in the cake code doesn’t do anything with the routing, thus ignoring the prefix we’ve set.
After some digging in the api i found a cake-way to generate the right url:
echo $form->create('User', array('url'=>$html->url(array('action'=>'dashboard_profile'))));
We use the html helper, that does parse the prefix part and generates a nice correct url, namely: /dashboard/user/profile
The html helper does check for any prefixes in the routing and generates the right url.
Combining the form->create and the html->url we get the right url.