I created an additional column and added icons at the end of the list to edit and delete the event.
That's what i
<g:form value="${it.id}">
<g:hiddenField name="id" value="${it.id}" />
<span class="simple"><g:actionSubmit class="editar" action="edit" value="${message(code: 'default.button.editar.label', default: ' ')}" /></span>
<span class="simple"><g:actionSubmit class="eliminar" action="delete" value="${message(code: 'default.button.eliminar.label', default: ' ')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Esta seguro que desea Eliminar?')}');" /></span>
</g:form>
I wrote The ID is ${it.id}, and he recognizes it and gives me an identification number, so I donโt know where the problem is. Any help would be greatly appreciated. Thank.
Update
So, I realized that the error was in the controller where the changes and deletion are defined
def edit = {
def entryInstance = Entry.get(params.id)
if (!entryInstance) {
flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'entry.label', default: 'Proyecto/Ruta'), params.id])}"
redirect(action: "list")
}
else {
return [entryInstance: entryInstance]
}
}
I think, since it says that params.id in get parameters I am not working correctly, what are my other alternatives?
source
share