Archive for the ‘grails’ Category

Using those _Install.groovy and _Upgrade.groovy scripts

Saturday, November 15th, 2008

So you've created your first Grails plugin and notice that you have these _Install.groovy and _Upgrade.groovy files in your plugin scripts directory.  "What are these for?" you ask, and promptly remove them - but if utilized them correctly, they're a great way to make sure your plugin works well with ...

Testing Plugin Presentation

Wednesday, November 12th, 2008

Last night I presented at the Minneapolis Groovy/Grails User Group meeting about the new Grails Testing Plugin created by Peter Ledbrook and G2One.  You can download the presentation in PDF form and browse through the sample code on GitHub (check out the test/unit directory).  The plugin makes it really simple ...

Your Grails domain class has more properties than you think!

Tuesday, June 10th, 2008

But you probably already knew that - things like 'id', 'version' and 'log' properties are added to every Grails domain class by the framework and are pretty obvious.  But there are a few more that might not be so familiar. Take a look at this domain class: class Book { ...

The elusive HTML ‘id’ attribute when using <g:form>

Monday, April 14th, 2008

In most Grails tags, the usual HTML attributes get passed through to the output HTML, for example the 'class' attribute below: results in: I tried to do this with a g:form tag and passed in an "id" attribute so I could reference the form in javascript. But you can't pass an ...

Using the showSource parameter trick with rendered templates

Monday, March 31st, 2008

This is a follow-up to my previous post about using the showSource parameter in Grails. If you're using templates to keep DRY, you may need to pay attention to the details of the stack trace that show which GSP contains the error. For instance, say my show.gsp renders a template ...