This commit is contained in:
oguzcagiran 2017-04-20 09:09:47 +00:00 committed by GitHub
commit 835b334751
2 changed files with 2 additions and 1 deletions

View file

@ -105,6 +105,7 @@ class PetController {
if (result.hasErrors()) {
pet.setOwner(owner);
model.put("pet", pet);
model.put("owner", owner);
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
} else {
owner.addPet(pet);

View file

@ -13,7 +13,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">Owner</label>
<div class="col-sm-10">
<span th:text="${pet.owner?.firstName + ' ' + pet.owner?.lastName}" />
<span th:text="${owner.firstName + ' ' + owner.lastName}" />
</div>
</div>
<input