zoran119
zoran119

Reputation: 11307

<g:each> produces too many line breaks

<g:each in="${users}" var="user">
${user.name}
</g:each>

produces

<br>
Bob<br>
<br>
Mike<br>

I never noticed this before... Any way to stop it (apart from putting the <g:each> and ${user.name} lines on the same line). Is this a bug?

Upvotes: 0

Views: 75

Answers (2)

Mimo
Mimo

Reputation: 6075

Try this:

<g:each in="${users}" var="user">${user.name}</g:each>

if you still get so many breaks the issue could be on the value stored in the db of ${user.name}

Upvotes: 1

Mr. Cat
Mr. Cat

Reputation: 3552

I guess the problem in content. Check what in ${user.name} and try to use ${user.name.encodeAsHTML()} and provide the result.

Upvotes: 0

Related Questions