I have a domain class:
class Person {
String name
Boolean likesGrails
Boolean isSmart
}
and want to pre process the data (create a new property friend) before passing it to a view (which will use friend to decide stuff):
def people = Person.list()
people.each {
it.friend = likesGrails && isSmart
}
How do i add this friend property? The code above doesn’t work (it complains that it.friend doesn’t exist).
You should just be able to add:
To your domain class, then access
person.friendin your view