<g:createLink controller="person" action="create" />
This will render:
/myapp/person/createThis means
This is useful because sometimes we need the URL information outside anchor tags. For example:
<script> function createPerson() { window.location.href = '<g:createLink controller="person" action="create" />'; } </script>
Will render:
<script> function createPerson() { window.location.href = '/myapp/person/create'; } </script>
<g:createLink controller="person" action="show" id="1"/>
This will render:
/myapp/person/show/1This is useful for creating links when the primary key is known.
Here is an example of using the tag with multiple parameters using any names.
<g:createLink controller="person" action="search" params="[firstName: 'John', lastName: 'Doe', age: '10']"/>
This will render
/myapp/person/search?firstName=John&lastName=Doe&age=10