I'm a Grails newbie. I'm trying to show an images thumbnail for every product in a site, like this:
<a href="#"><img src="${resource(dir:"images", file: "Nikon.jpg") }"/></a>/* 1 */
The problem here is that I want to save the image link in the database, and get the link by:
${fieldValue(bean: productInstance, field: "image")} /* 2 */
But I can't replace the /* 2 / code into the places of "Nikon.jpg" in / 1 */, it causes syntax error!
After doing some research, I see that most tutorials show how to display image that stores directly in database (for example, How to display image in grails GSP?). I'm not sure if that approach is better, but I still want to take image link from database.
I also tried to search grails tag library to find any support tag, but with no success. Can anyone give me a hint?