public function createAction(Request $request, $attributeId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Attribute $attribute */
        $attribute = $em->getRepository('EcommerceBundle:Attribute')->find($attributeId);

        if (!$attribute) {
            throw $this->createNotFoundException('Unable to find Attribute entity.');
        }

        $entity  = new AttributeValue();
        $form = $this->createForm(new AttributeValueType(), $entity);
        $entity->setAttribute($attribute);

        $form->bind($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            $this->get('session')->getFlashBag()->add('success', 'value.created');

            return $this->redirect($this->generateUrl('ecommerce_attributevalue_show', array('attributeId' => $attributeId, 'id' => $entity->getId())));
        }

        return array(
            'entity'    => $entity,
            'attribute' => $attribute,
            'form'      => $form->createView(),
        );
    }