I'm using Symfony 2.3.4 and of course Twig.
Now, I'm trying to set twig's function path() to a form's action, the problem is... well that I can't.
when I run this:
$('#prof_create').prop('action',"{{ path('profesor_create') }}");
what I'm aiming for is this result:
<form id="prof_create" class="form-horizontal sf_admin_form_area"
action="/SVN/Symfony/web/app_dev.php/admin/profesor/create" method="post"
{{ form_enctype(form) }}>
being {{ path('profesor_create') }} -> /SVN/Symfony/web/app_dev.php/admin/profesor/create
the javascript file shows no error nor warning but it's really not working because when I try to submit the form:
Error
No route found for "POST /admin/profesor/%7B%7B%20path(%27profesor_create%27)%20%7D%7D"
which means it did not "transform"
{{ path('profesor_create') }}
into
/SVN/Symfony/web/app_dev.php/admin/profesor/create
what I want NOT to do is to write down the entire address in the js function, is there a way to get this done?
Thanks in adv.