In a tag like below:
<a data-url="/new/request/showText/${requestInstance.id}"> view text</a>
Is there a way to not hardcode the url like I have?
I tried using <g:link action="showText" id="${requestInstance.id}"> but that renders to an anchor tag.
What I’m doing might be find but I’m just curious if there is a better way to do this in grails?
You may use
${createLink(action:'myaction',params:[datasetId:dataset.id])}for full control. It just returns something like
http://myapp/myaction/123and supportsall the params whichg:linksupports.To be more specific:
should work.