Check the url and redirect if necessary
All you need to do is check that the slug in the url is the current slug, and if not, 301 redirect to the right url:
function view($id, $slug = null) {
$record = $this->Foo->findById($id);
if ($record['Foo']['slug'] !== $slug) {
return $this->redirect(
array(
$id,
$record['Foo']['slug']
),
301
);
}
...
}
That way, if the slug is accidentally wrong, or if the slug changes (original record updated) the url is maintained correct and there is an enforced canonical url for each record.