Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Controllers, Scaffolding
-
Labels:None
-
Environment:OS X, WIndows & Linux I guess
Description
I have lots of controllers coded exactly the same with just one line in each controller class, i.e. 'def scaffold = true'. It would be helpful if instead of copying and pasting controller classes containing just one line I could add that one line to my domain class instead. This would effectively be indicating that I wanted to use dynamic scaffolding for that domain class, e.g.
class Book {
String title
String author
def scaffold = true
}
As well as avoiding copying and pasting whole classes for just one line of identical content this would allow me to much more easily determine which controllers have meaningful code within controller classes, i.e. I could choose that only the non-dynamically scaffolded controller classes would exist.
I envisage logic something like this,
- Look for a controller for each domain class
- If no controller found and and 'def dynamicScaffolding = true' then generate/use a dynamic scaffolding controller in memory
A side benefit is that an entry-level/demo/example application would just require coding of the domain class and could be demonstrated as working code in just four steps, i.e.
1. grails create-app
2. grails create-domain-class
3. edit domain class
4. grails run app
My proposal is that this new feature co-exists with the current dynamic scaffolding mechanism, rather than replaces it.
There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3
for 1.2 final only issues considered blocking will now be fixed