By default if you are creating a controller using the following command:
Suppose your controller is based on an existing DomainClass, you might want to jump start using scaffolding.
You might be opening the controller file and commenting the code which Grails has created for you.
Grails will generate the controller with scaffold magic keyword by default.
Hope you like this tip (if you are a beginner of Grails and if you are cursing with prototyping for numerous controllers).
grails create-controller org.example.DomainClass
Suppose your controller is based on an existing DomainClass, you might want to jump start using scaffolding.
You might be opening the controller file and commenting the code which Grails has created for you.
class DomainClassController {
def index = { }
}
You might be adding the magic keyword that allows scaffolding later.def index = { }
}
class DomainClassController {
//def index = { }
def scaffold = true
}
If you have many number of controllers to be created for prototyping and want to avoid this commenting and copy/paste activities use the following command://def index = { }
def scaffold = true
}
grails create-scaffold-controller org.example.DomainClass
Grails will generate the controller with scaffold magic keyword by default.
Hope you like this tip (if you are a beginner of Grails and if you are cursing with prototyping for numerous controllers).
0 comments:
Post a Comment