I have a form in a blade view, like this:
<form id="delete_form" method="post" action="">
@method('DELETE')
@csrf
<input type="hidden" id="delete_type" name="delete_type" value="">
</form>
The value of action
should be something like {{ route('personas.destroy', ['persona'=>$persona]) }}
Up to here, all right. The problem is that the object $persona
has to be selected dynamically from javascript, because there are several links that should be able to launch that form, and each one must pass a different $persona
object.
I have tried everything that has occurred to me, but the action
of the form is not constructed correctly.
How can a form be made in which the object can be changed dynamically in each call?
Thank you.