title: symfony2 update entity out of modal
body: <p>almost whole night I'm trying to update an entity with a form in a modal, but it doesn't work...</p>
  
  <p>My twig template looks like :</p>
  
  <pre><code>    {% for entity in entities %}
    &lt;tr&gt;
      &lt;td class="text-center"&gt;{{ entity.id }}&lt;/td&gt;
      &lt;td class="text-center"&gt;{{ entity.cashbackDays }} Tage&lt;/td&gt;
      &lt;td class="text-center"&gt;{{ entity.cashbackPercent }} %&lt;/td&gt;
      &lt;td class="text-center"&gt;{{ entity.nettoDays }} Tage&lt;/td&gt;
      &lt;td class="text-center"&gt;
        &lt;a data-toggle="modal" data-target="#editCashbackModal" class="btn btn-xs btn-default" href="{{ path('cashback_edit', { 'id': entity.id }) }}"&gt;&lt;i
            class="fa fa-edit"&gt;&lt;/i&gt;&lt;/a&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  {% endfor %}
  &lt;/tbody&gt;
        &lt;div class="modal fade" id="editCashBackModal" tabindex="-1" role="dialog" aria-labelledby="editCashBackModalLabel" aria-hidden="true"&gt;
  
        &lt;/div&gt;
  </code></pre>
  
  <p>the modal template looks like:</p>
  
  <pre><code>    &lt;div class="modal-dialog"&gt;
    &lt;div class="modal-content"&gt;
      &lt;div class="modal-header"&gt;
        &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span
            aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
        &lt;h4 class="modal-title" id="editCashBackModalLabel"&gt;Skontoschlüssel bearbeiten&lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
        {{ form(edit_form) }}
  
        &lt;ul class="record_actions"&gt;
          &lt;li&gt;
            &lt;a href="{{ path('cashback') }}"&gt;
              Back to the list
            &lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;{{ form(delete_form) }}&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I think I got problems with the variable in the URl but I don't know how to fix it.</p>
  
  <p>This is the part of my controller:</p>
  
  <pre><code>public function editAction($id)
  {
      $em = $this-&gt;getDoctrine()-&gt;getManager();
  
      $entity = $em-&gt;getRepository('sulzerAppBundle:Cashback')-&gt;find($id);
  
      if (!$entity) {
          throw $this-&gt;createNotFoundException('Unable to find Cashback entity.');
      }
  
      $editForm = $this-&gt;createEditForm($entity);
      $deleteForm = $this-&gt;createDeleteForm($id);
  
      return array(
          'entity'      =&gt; $entity,
          'edit_form'   =&gt; $editForm-&gt;createView(),
          'delete_form' =&gt; $deleteForm-&gt;createView(),
      );
  }
  
  /**
  * Creates a form to edit a Cashback entity.
  *
  * @param Cashback $entity The entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
  private function createEditForm(Cashback $entity)
  {
      $form = $this-&gt;createForm(new CashbackType(), $entity, array(
          'action' =&gt; $this-&gt;generateUrl('cashback_update', array('id' =&gt; $entity-&gt;getId())),
          'method' =&gt; 'PUT',
      ));
  
      $form-&gt;add('submit', 'submit', array('label' =&gt; 'Update'));
  
      return $form;
  }
  </code></pre>
  
  <p>The Error is that the modal doesn't open at click on edit</p>