I'm working with Grails 2.1.0 and bumped with this 2 year old post: Is there a way to make functions accessible across controllers in Grails?
In there, Burt suggest to create a function that will be accessible to all controllers using Bootstrap. I have tried it with the findings that it works, however every time I modify the controller (add or delete whatever you may think) Grails gives me:
No signature of method: mycontroller.myfunctionfrombootstrap() is applicable for argument types: () values: []
Is this a "feature" of Grails 2.1.0? Am I missing something?
Upgrading Grails IS NOT an option.
In bootstrap I have:
for (controllerClass in grailsApplication.controllerClasses) {
controllerClass.clazz.metaClass.myfunctionfrombootstrap= {
return stuff;
}
}