// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package test

class TestController {
    def index() {
        [data: DB.getAll(), options: ["", T1.VER, T1.NOTVER]]
    }
    def add() {
        DB.saveOne(new T1(f1: Integer.parseInt(params.f1), f2: params.f2, f3: params.f3)) 
        redirect(action: "index")
    }
}
                                            
