Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0-RC3
-
Fix Version/s: 1.2 final
-
Component/s: Documentation
-
Labels:None
-
Environment:Grails 1.0 RC3
-
Patch Submitted:Yes
Description
In chapter 6.3 of the Reference Documentation is a wrong taglib example:
class SimpleTagLib {
def emoticon = { attrs, body ->
out << body() << attrs.happy == 'true' ? " :-)" : " :-("
}
}
The correct code would be:
class SimpleTagLib {
def emoticon = { attrs, body ->
ut << body() << (attrs.happy? ' :-)' : ' :-(')
}
}
I've replaced the GStrings with Strings due to the better performance ![]()
Sorry, there is copy&paste error in my code.
class SimpleTagLib {
def emoticon = { attrs, body -> out << body() << (attrs.happy? ' :-)' : ' :-(') }
}
The 'o' of 'out' was missing.
Amendmend to avoid misunderstandings: The change from GString to String has nothing to do with the error in the example code.