I have loop in gsp like this:
<g:each in="${personInstance.followed}" var="c" >
<g:if test="${c.equals(person)}">
<g:link id="${person.id}" action="unfollow" controller="message">unfollow</g:link>
</g:if>
</g:each>
How can I use break in g:each or g:if? Any ideas?
It sounds as if you are looking to display one thing or another based on if an instance is within a collection. Your best bet is to use
contains
on the collection. For example: