Grails create link to homepage

After reading the Zeroturnaround’s bake off of modern jvm web framework I thought I would give Grails one last go. After all, in the report it beat the likes of Wicket, Spring, Play, etc

Intellij 12 made quick work of setting up a project and soon I had a functioning website. All good so far, I remembered my basic Rails/Grails knowledge from before and have to admit I was able to do a lot in a very short period of time. 

However one of the simplest links stopped me in my tracks and it took a disproportionate about of googling to figure it out. 

How to link to the homepage/root?

After much searching the best I got was

 <a href=”${createLink(uri: ‘/’)}”>home</a>

Easy once you see it!! Hopefully I will save you some the time too

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s