Some mandatory parameters are missing ("user") to generate a URL for route
<p>My motivation is to edit values displayed in this edit form. But when I press edit button it throws out this error. I can't figure it out. Can anyone help what is missing in my code?</p>

<blockquote>
  <p>An exception has been thrown during the rendering of a template ("Some
  mandatory parameters are missing ("user") to generate a URL for route
  "sokosimu_editor_edit_editoruser".") in
  SokosimuEditorBundle:User:editUser.html.twig at line 7. 500 Internal
  Server Error - Twig_Error_Runtime</p>
</blockquote>

<p><strong>Router</strong></p>

<pre><code>sokosimu_editor_edit_editoruser:
    path: /edit/editoruser/{user}
    defaults: {_controller:SokosimuEditorBundle:Editor:editEditorUser}
    requirements:
            _method:  GET|POST
</code></pre>

<p><strong>Controller</strong></p>

<pre><code>    public function editEditorUserAction(User $user,Request $request){

    $form = $this-&gt;createForm(new EditUserType(),$user);

    //2. handle the submit (will happen on POST)
    $form-&gt;handleRequest($request);
    if($form -&gt;isValid() &amp;&amp; $form-&gt;isSubmitted()){
    }
    $em = $this-&gt;get('doctrine')-&gt;getManager();

    $editUser = $user -&gt;getEditoruser();
    return $this-&gt;render('SokosimuEditorBundle:User:editUser.html.twig', array(
        'form' =&gt; $form-&gt;createView()
    ));
</code></pre>

<p>}</p>

<p><strong>View</strong></p>

<pre><code> {% block title %}Edit User{% endblock%}

 {% block body %}

&lt;form action="{{ path('sokosimu_editor_edit_editoruser') }}" method="post" {{ form_enctype(form) }} class="formedit"&gt;
    {{ form_errors(form) }}

    {{ form_row(form.alias)}}
    {{ form_row(form.email) }}
    {#{{ form_row(form.password) }}#}
    {{ form_row(form.mobile) }}
    {{ form_row(form.submit) }}
    {{ form_rest(form) }}
  &lt;/form&gt;
 {% endblock %}
</code></pre>

<p><strong>Form</strong></p>

<pre><code>&lt;?php

 namespace Sokosimu\EditorBundle\Form\Type;

 use Symfony\Component\Form\Extension\Core\Type\SubmitType;
 use Symfony\Component\Form\AbstractType; 
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\OptionsResolver\OptionsResolverInterface;

 class EditUserType extends AbstractType
 {

   public function buildForm(FormBuilderInterface $builder, array $options)
  {
     $builder-&gt;add('alias','text',array('required'=&gt;false));
     $builder-&gt;add('email', 'email',array('required'=&gt;true));
    // $builder-&gt;add('password','password',array('required'=&gt;true));
     $builder-&gt;add('mobile','text',array('required'=&gt;false));
     $builder-&gt;add('submit', 'submit');
  }

   public function setDefaultOptions(OptionsResolverInterface   $resolver)
  {
    $resolver-&gt;setDefaults(array(
        'data_class' =&gt; 'Sokosimu\UserBundle\Entity\User'
     //   'data_class' =&gt; NULL
    ));
}

public function getName()
 {
   return 'editUser';
 }
}
</code></pre>