Thymeleaf Edit View

Descripción

Create a Thymeleaf form for editing an entity


File Template: ✅


Prefix

thyme:edit


Scopes

html


Snippet de código

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>Edit ${1:MyEntity}</title>
</head>
<body>
	<h1>Edit ${1:MyEntity}</h1>
	<form th:action="@{'/${2:entidades}/' + ${item.id}}" th:object="${item}" method="post">
		<label for="name">Name:</label>
		<input type="text" id="name" th:field="*{name}" />
		<!-- Add other attributes here -->
		<button type="submit">Update</button>
	</form>
	<a th:href="@{'/${2:entidades}'}">Cancel</a>
</body>
</html>