title: Refresh page in symfony2 at the end of Ajax call
body: <p>How can I refresh a page after an ajax call is executed. 
  My Ajax call is </p>
  
  <pre><code> $.ajax({
           type: "POST",
           data: data,
           url:"{{ path('v2_pm_patents_trashpatents') }}",
           cache: false
  });
  </code></pre>
  
  <p>The method that is executed by this ajax is </p>
  
  <pre><code> public function trashpatentAction(Request $request){
      if ($request-&gt;isXmlHttpRequest()) {
          $patent_id = $request-&gt;get("pid");
          $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
          $patent = $em-&gt;getRepository('MunichInnovationGroupPatentBundle:SvPatents')-&gt;find($patent_id);
          if (!$patent) {
              throw $this-&gt;createNotFoundException('No patent found for id '.$patent_id);
          }
          $patent-&gt;setIs_deleted(1);
          $em-&gt;flush();
      }
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>Portfolio Controller Index Action</p>
  
  <pre><code>public function indexAction(Request $request) {
       $switch_form = $this-&gt;createForm(new SwitchPortfolioType($portfolios));
       ////rest of action code
       return $this-&gt;render('MunichInnovationGroupPatentBundle:Portfolio:index.html.twig', array('new_patentgroup_form' =&gt; $new_patentgroup_form-&gt;createView(),'switch_form' =&gt; $switch_form-&gt;createView(), 'new_form' =&gt; $new_form-&gt;createView(), "portfolios" =&gt; $portfolios ,"selected_portfolio" =&gt; $selected_portfolio,"portfolio_groups" =&gt; $portfolio_groups,"patents" =&gt; $patents));
  
  }
  </code></pre>
  
  <p>Index.html.twig</p>
  
  <pre><code> &lt;form name="portfolios" action="{{ path('v2_pm_portfolio') }}" method="post" &gt;
              {{ form_widget(switch_form) }}
              &lt;input type="submit"class="portfolio_input button2 tooltip" value="Switch"&gt;
   &lt;/form&gt; 
  </code></pre>
  
  <p>SwitchPortfolioType</p>
  
  <p>
  
  <pre><code>use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilder;
  
  class SwitchPortfolioType extends AbstractType
  {
  public function __construct($portfolios)
  {
      $this-&gt;portfolios = $portfolios;
  }
  
  
  public function buildForm(FormBuilder $builder, array $options)
  {
      $builder
      -&gt;add('', 'choice', array(
          'choices'   =&gt; array(
                  'test' =&gt; 'Test'
          ),
              'empty_value' =&gt; 'Switch your Portfolio',
      ));
  }
  
  public function getName()
  {
      return 'switch_portfolio';
  }
  </code></pre>
  
  <p>}</p>
  
  <p>At the end of this action I want to refresh the page </p>
  
  <p>How can I do this?</p>