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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/docs/guide/gspLinks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Let's take a look at one more common GSP tag: `<g:link>`
[source,xml]
.grails-app/views/home/index.gsp
----
include::{sourceDir}/grails-app/views/home/index.gsp[indent=0,lines="34..36"]
include::{sourceDir}/grails-app/views/home/index.gsp[indent=0,lines="33..35"]
----

`<g:link>` renders an HTML `<a>` 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 http://docs.grails.org/latest/ref/Tags/link.html[Grails documentation] for more.