Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
Added a hidden input, passing the patch value in method to the patch request
  • Loading branch information
brunopuzoni committed Dec 14, 2020
1 parent 37a8c1e commit e043a96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h5 class="modal-title">Insira uma nova tarefa</h5>

<!-- Modal body -->
<div class="modal-body">
<form action="/" method="POST">
<form action="/create" method="POST">
<input class="form-control" type="text" id="tarefa" name="tarefa" placeholder="Descrição"> <br>
<button class="btn btn-success">Adicionar</button>
</form>
Expand All @@ -127,10 +127,11 @@ <h5 class="modal-title">Alterar tarefa</h5>

<!-- Modal body -->
<div class="modal-body">
<form action="/update/{{tarefa.id}}" method="POST" id="form-update">
<form action="/update/{{tarefa.id}}?_method=PATCH" method="POST" id="form-update">
<input class="form-control" type="text" id="updtarefa" name="updtarefa" placeholder="Alterar descrição"> <br>
<input class="form-control" type="hidden" id="updid" name="updid">
<input type="submit" class="btn btn-success" value="Alterar" onclick="updateForm()">
<input class="form-control" type="hidden" id="method" name="method" value="patch">
<input type="submit" class="btn btn-success" value="Alterar">
</form>
</div>

Expand Down

0 comments on commit e043a96

Please sign in to comment.