How to create the following link in grails using createlink. I have a list of various parameter, at each iteration, it should generate the link as:
Asked
Active
Viewed 587 times
1 Answers
3
You should use createlink, look in grails docs here
In your case -
<g:createLink controller="search" action="index"
params="[paramater: '123']"/>
or in you can do like this -
<a href="${g.createLink(controller : 'search', action : 'index',params : [paramater : '123',secondParamater: '5'])}"></a>
Important. This will return params separated with '?' not '#' (Read more about using '#' here)
http://localhost:8080/search?parameter=123&secondParamater=5
But if you really want to use hash parmater(#) -
<a href="${g.creteLink(..)}#paramter=123"> </a>
*(Can't be sure with your controller/action mapping)

Parth Soni
- 11,158
- 4
- 32
- 54

Roman Romanovsky
- 578
- 5
- 9