Showing posts with label grails. Show all posts
Showing posts with label grails. Show all posts

Thursday, March 06, 2008

Grails Date Trick

If you have a Date field in one of your domain classes, for instance:
class Person{
String Name
Date Birthday
}
and you're struggling to figure out a way to get stuff into it without explicitly creating a date and converting strings or integers into it, Grails provides a handy (yet not documented?) set of properties for you. In our example, I could set birthday_year, birthday_month, birthday_day, birthday_hour, etc.. I found this by digging in the scaffolded views and figuring out how they render the tag. Now, maybe you don't have to dig.

Friday, February 29, 2008

Gotcha: Grails Auto Recompile Doesn't Do GSP

Grails does the auto recompile thing, much like Turbogears etc., but it doesn't seem to work for gsp pages, in particular, main.gsp. Which can trip you up, if you're trying to make a couple simple changes to your first Grails app.

Wednesday, February 27, 2008

Gotcha: Grails Capitalization

So, apparently Grails doesn't like Controllers starting with multiple capitol letters (i.e. TLAcronym). If you create a domain class with all lowercase, it will capitalize it for you, but if you try to create TLAcronym, it happily plays along. Then if you generate-all or do scaffolding for that domain class, you won't be able to access your controller. I've raised an issue for this here: GRAILS-2541.