title: An exception has been thrown during the rendering of a template
body: <p>I am updating a value using id of a product in symfony2.16 also using MngoDBbundle</p>
  
  <p>but I am getting error like this</p>
  
  <blockquote>
    <p>An exception has been thrown during the rendering of a template ("The
    "acme_store_update" route has some missing mandatory parameters
    ("id").") in AcmeStoreBundle:Default:index.html.twig at line 1.</p>
  </blockquote>
  
  <p>this is my controller please check update action</p>
  
  <pre><code>&lt;?php
  
  namespace Acme\StoreBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Acme\StoreBundle\Document\Product;
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\HttpFoundation\Request;
  
  
  class DefaultController extends Controller
  {
      /**
       * @Route("/hello/{name}")
       * @Template()
       */
      public function indexAction($name)
      {
          return array('name' =&gt; $name);
      }
  
  // ...
  
      /**
       * @Route("/create", name="acme_store_create")
       * @Template()
       */
      public function createAction(Request $request)
      {
          $product = new Product();
          //$product-&gt;setName('apple');
          //$product-&gt;setPrice('19.99');
          $form = $this-&gt;createFormBuilder($product)
              -&gt;add('name', 'text')
              -&gt;add('price', 'text')
              -&gt;getForm();
          if ($request-&gt;getMethod() == 'POST') {
              $form-&gt;bind($request);
              if ($form-&gt;isValid()) {
                  $req = $request-&gt;request-&gt;get('form');
                  $product-&gt;setName($req['name']);
                  $product-&gt;setPrice($req['price']);
                  $dm = $this-&gt;get('doctrine.odm.mongodb.document_manager');
                  $dm-&gt;persist($product);
                  $dm-&gt;flush();
                  return new Response('Name ='.$product-&gt;getName().', price ='.$product-&gt;getPrice());
              }
           }
              return $this-&gt;render('AcmeStoreBundle:Default:index.html.twig', array(
                  'form' =&gt; $form-&gt;createView(),
              ));
      }
      // ...
      /**
       * @Route("/show/{id}", name="acme_store_show")
       * @Template()
       */
      public function showAction($id)
      {
          $product = $this-&gt;get('doctrine.odm.mongodb.document_manager')
              -&gt;getRepository('AcmeStoreBundle:Product')
              -&gt;find($id);
  
          if (!$product) {
              throw $this-&gt;createNotFoundException('No product found for id '.$id);
          }
          return new Response('Name ='.$product-&gt;getName().', price ='.$product-&gt;getPrice());
          // do something, like pass the $product object into a template
      }
      // ...
      /**
       * @Route("/update/{id}", name="acme_store_update")
       * @Template()
       */
      public function updateAction(Request $request,$id)
      {
          $dm = $this-&gt;get('doctrine.odm.mongodb.document_manager');
          $product = $dm-&gt;getRepository('AcmeStoreBundle:Product')-&gt;find($id);
          $form = $this-&gt;createFormBuilder($product)
              -&gt;add('name', 'text')
              -&gt;add('price', 'text')
              -&gt;getForm();
          if ($request-&gt;getMethod() == 'POST') {
              $form-&gt;bind($request);
              if ($form-&gt;isValid()) {
                  $req = $request-&gt;request-&gt;get('form');
                  $product-&gt;setName($req['name']);
                  $product-&gt;setPrice($req['price']);
                  $dm-&gt;flush();
                  return new Response('Name ='.$product-&gt;getName().', price ='.$product-&gt;getPrice());
              }
          }
              return $this-&gt;render('AcmeStoreBundle:Default:index.html.twig', array(
                  'form' =&gt; $form-&gt;createView(),
              ));
  
      }
              // ...
  
  }
  </code></pre>
  
  <p>my index.html.twig is</p>
  
  <pre><code>&lt;form action="{{ path('acme_store_update') }}" method="post" {{ form_enctype(form) }}&gt;
      {{ form_widget(form) }}
  
      &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How to update the value using id please help me</p>