I am new to Grails. I am trying to show a thumbnail of images for each product on the site, for example:
<a href="#"><img src="${resource(dir:"images", file: "Nikon.jpg") }"/></a>/* 1 */
The problem is that I want to save the image link in the database and get the link:
${fieldValue(bean: productInstance, field: "image")}
But I can not replace the code / * 2 / with the place "Nikon.jpg" in / 1 * /, this causes a syntax error!
After a series of studies, I see that most tutorials show how to display an image that is stored directly in the database (for example, How to display an image in grails GSP? ), I'm not sure if this approach is better, but I still want to use the link to the image from the database.
I also tried to find the grails tag library to find any support tag, but without success. Can someone give me a hint?
source
share