Details
Description
Using the following mapping for my example:
public class CustomUrlMappings {
static mappings = {
"/$mslug/$controller/$action/$id?" {
}
}
}
...and the following url:
http://localhost:8080/appname/acme/product/list
Here are the <g:link> examples and results (none of which work correctly)
1) This is the example from the docs, but it treats the url token as a standard query param.
<g:link controller="product" action="create" params="[mslug:params.mslug]">New Product</g:link>
http://localhost:8080/appname/product/create?mslug=acme
2) Looks to have had the slash escaped.
<g:link url="[controller:params.mslug+'/product',action:'create']">New Product</g:link>
http://localhost:8080/appname/acme%2Fproduct/create
3) Same result as #2
<g:link controller="${params.mslug}/product" action="create">New Product</g:link>
http://localhost:8080/appname/acme%2Fproduct/create
4) Trying something different...close but not right.
<g:link url="${params.mslug}" action="create">New Product</g:link>
http://localhost:8080/appname/acme/product/acme
5) Same as #4.
<g:link url="${params.mslug}">New Product</g:link>
http://localhost:8080/appname/acme/product/acme
Issue Links
| This issue duplicates: | ||||
| GRAILS-2566 | g:form url-encodes slash |
|
|
|
number 1) works now, number 2 and 3 are invalid. You cannot include slashes in the action and controller names