Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create grails <g:link>

Tags:

grails

I have a problem using <g:link> tag.

When I use

<g:link namespace="print" controller="home" action="terms">Terms &amp; Conditions</g:link>

It creates the following link

<a href="/app/print/home/terms">Terms &amp; Conditions</a>

But I would like to create a link such as

<a href="/app/print/home/terms#testValue">Terms &amp; Conditions</a>

How can this be achieved?

I tried using "${createLink(controller: 'home', action: 'terms')} but it does not support namespace attribute.

like image 752
Biswas Avatar asked Aug 26 '26 06:08

Biswas


1 Answers

Ref: grails-doc

You may use fragment (often called anchor tag).

<g:link namespace="print" controller="home" action="terms" fragment="testValue">Terms &amp; Conditions</g:link>

like image 157
Salman Avatar answered Aug 29 '26 15:08

Salman