How to redirect from a controller using a named URL?

I have a URL mapping as shown below:

static mappings = { name register: "/register" { controller = "account" action = "createuser" } } 

and I want to redirect using this mapping from the controller with something like:

 redirect mapping:'register' 

Unfortunately, unlike createLink tag lib, it seems that redirect does not accept mapping as an input parameter.

So my question is: how can I use URL name matching for redirects?

+4
source share
1 answer

You can combine two:

 redirect url: createLink(mapping: 'register') 
+8
source

All Articles