In my Grails app I have various images:
/web-app/images/competition/foo bar.png
/web-app/images/competition/foo bar2.png
/web-app/images/competition/foo bar3.png
The name of the image to be displayed is stored in the model that's passed to the GSP. I'm trying to create a link to this using the <r:img>
tag provided by the resources plugin. So far I've tried:
<r:img file="competition/${imageName}.png"/>
<r:img file="competition/${imageName.encodeAsHTML()}.png"/>
<r:img file="competition/${imageName.encodeAsURL()}.png"/>
But none of these seem to work. I realise renaming the file would make my life a lot simpler, but sadly this is not possible.