/**
  * {@inheritdoc}
  */
 public function editAction(Request $request)
 {
     $resource = $this->manager->findResource($request);
     if (null === $resource) {
         return $this->redirectToAction('index');
     }
     $groups = $this->manager->getGroupsCollection();
     $form = $this->manager->getForm($resource, ['class' => 'attributeGroupEditor']);
     if ($form->handleRequest()->isSubmitted()) {
         if ($form->isValid()) {
             $this->manager->updateResource($resource);
         }
         return $this->createFormDefaultJsonResponse($form);
     }
     return $this->displayTemplate('edit', ['resource' => $resource, 'groups' => $groups, 'form' => $form]);
 }
 /**
  * {@inheritdoc}
  */
 public function editAction(Request $request)
 {
     $resource = $this->manager->findResource($request);
     if (null === $resource) {
         return $this->redirectToAction('index');
     }
     $groups = $this->manager->getGroupsCollection();
     $form = $this->manager->getForm($resource, ['class' => 'attributeGroupEditor']);
     if ($form->handleRequest()->isValid()) {
         $this->manager->updateResource($resource);
         if ($form->isAction('continue')) {
             return $this->getRouterHelper()->redirectToAction('edit', ['id' => $resource->getId()]);
         }
         return $this->redirectToAction('index');
     }
     return $this->displayTemplate('edit', ['resource' => $resource, 'groups' => $groups, 'form' => $form]);
 }