File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/grails/grails-app/taglib Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,20 @@ class ApplicationTagLib {
8585
8686 def controller = attrs. remove(" controller" )
8787 def action = attrs. remove(" action" )
88- def params = attrs. remove(" params" )
88+ def params = attrs. params ? attrs . remove(' params' ) : [:]
8989 def mapping = grailsUrlMappingsHolder?. getReverseMapping(controller,
9090 action,
9191 params)
92- def url = mapping?. createURL(params)
92+ def url
93+ try {
94+ params. controller = controller
95+ if (action) params. action = action
96+ url = mapping?. createURL(params)
97+ }
98+ finally {
99+ params. remove(' controller' )
100+ params. remove(' action' )
101+ }
93102 if (url) {
94103 out << url
95104 }
@@ -143,7 +152,7 @@ class ApplicationTagLib {
143152 }
144153 }
145154 }
146- out << ' >'
155+ out << ' >'
147156 out << body()
148157 out << " </${ attrs.name} >"
149158 }
You can’t perform that action at this time.
0 commit comments