groovygrails

Trying to compute age in groovy

I have a date object that holds a persons birthday. My code looks like: def getAge(){ //birthday, birthYear, birthMonth, birthDayOfMonth are class level properties def c= new GregorianCalendar(birthYear, birthMonth-1, birthDayOfMonth) birthday = c.time //What do I do now? } I need to return the age of the person. How...

Domain object referring to a reference table in Grails GORM

I have a domain object called User: class User{ String username; String firstName; String lastName; Zipcode zip; } I also have a Zip Code object: class Zipcode { String zip; String city; String state; Float lat; Float long; } The zipcode table should never be modified as it contains static reference data prepopula...

Grails: How to make everything I create Upper Case?

Hello, I am currently using CSS to change everything I write to upperCase when I create an entry, but that is not enough. When I save things, the text shown in the text fields is upper case, but the real value that Grails stores stays in lower case. I am assuming I'd need to change something in the controller or anything. Maybe transf...