public function updateAction($username)
{
$user = $this->findUserBy('username', $username);
$form = $this->container->get('fos_user.form.user');
$process = $form->process($user);
if ($process) {
$this->setFlash('fos_user_user_update', 'success');
$userUrl = $this->container->get('router')->generate('fos_user_user_show', array('username' => $user->getUsername()));
return new RedirectResponse($userUrl);
}
return $this->container->get('templating')->renderResponse('FOSUserBundle:User:edit.html.' . $this->getEngine(), array('form' => $form, 'username' => $user->getUsername()));
}