Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line shift for g:link fragment #46

Open
wants to merge 1 commit into
base: grails3
Choose a base branch
from
Open

Fix line shift for g:link fragment #46

wants to merge 1 commit into from

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