Saturday, 28 September 2013

Grails How to show a different link name in a form

Grails How to show a different link name in a form

In my domain i have a one to many relationship with Inventory and
Inventory Item. This is the snippet from the gsp. It shows each inventory
item assigned to a specific inventory.
<g:if test="${inventoryInstance?.inventoryItem}">
<li class="fieldcontain">
<span id="inventoryItem-label" class="property-label"><g:message
code="inventory.inventoryItem.label" default="Inventory Item"
/></span>
<g:each in="${inventoryInstance.inventoryItem}" var="i">
<span class="property-value"
aria-labelledby="inventoryItem-label"><g:link
controller="inventoryItem" action="show"
id="${i.id}">${i?.encodeAsHTML()}</g:link></span>
</g:each>
</li>
</g:if>
Problem is the links shown is package.InventoryItem: 1
how do you change it to the InventoryItem's name ( i have a name row in my
database)

No comments:

Post a Comment