Skip to content

Conversation

@mpiffault
Copy link

Current version of first grails app documentation has a glitch on the 7.4 GSP Tags Links section. The code fragment lacks of the first line, and has a useless bottom line :

7.4 GSP Tags Links

Let’s take a look at one more common GSP tag: <g:link>
grails-app/views/home/index.gsp

    ${vehicle.name} - ${vehicle.year} ${vehicle.make.name} ${vehicle.model.name}
</g:link>

<g:link> renders an HTML tag, but it has the advantage in that it allows you to specify your link target following Grails conventions, such as this example (using the controller, action and id attributes). <g:link> is also smart enough to follow our URL mappings, so if we change the URL mapping for vehicle/show, the <g:link> tag will still render the correct URL. There’s many more attributes supported by <g:link> - see the Grails documentation for more.

@mpiffault
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant