public function updateAction(Request $request, Index $entity)
{
$this->throw404IfNotFound($entity);
$em = $this->getDoctrine()->getManager();
$editForm = $this->createEditForm($entity)->add('save', 'submit');
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
$this->successFlashBag('successful.update');
return $this->redirect($this->generateUrl('ojs_admin_index_edit', array('id' => $entity->getId())));
}
return $this->render('OjsAdminBundle:AdminIndex:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
}