Sherif
Sherif

Reputation: 431

Grails: how to pass link in message's args

In the GSP i want to pass to the agrs a link in <g:message code='myCode' args='link'> , i tried args="${createLink(controller:'myCon',action:'myAc')}" but this is not working.

Any ideas?

Upvotes: 1

Views: 479

Answers (1)

Joshua Moore
Joshua Moore

Reputation: 24776

Should be easy enough with the following in your messages.properties file

my.message.key=Just a link to <a href="{0}">Something</a>

and then calling it like this:

<g:message code="my.message.key" args="[createLink(controller: 'foo', action: 'baz')]" />

Keep in mind that arguments for message codes are an array, thus the brackets used above.

Upvotes: 3

Related Questions