10 Creating views - Reference Documentation
Authors: Alejandro GarcĂa Granados
Version: 0.4
10 Creating views
Today, most modern web applications make strong use of AJAX and Responsive Web Design, two paradigms that enhances the user experience by making an application looks like a desktop-app in the browser. The Optimus plugin uses the Grails AJAX taglibs and the 3.0.0 version of the Twitter Bootstrap framework, a powerful tool that makes easier the generation of responsive web pages.You can generate all the GSP files by executing the create-views command:grails create-views [domainClass]
grails-app/controllers/HomeController.groovy
grails-app/views/home/_index.gsp
grails-app/views/index.gsp
grails-app/views/_header.gsp
grails-app/views/_topMenu.gsp
grails-app/views/_menu.gsp
src/templates/scaffolding/_content.gsp
src/templates/scaffolding/_list.gsp
src/templates/scaffolding/_form.gsp
src/templates/scaffolding/renderEditor.template
mypackage.Person
, the plugin will generate the following files:
grails-app/views/person/_content.gsp
grails-app/views/person/_list.gsp
grails-app/views/person/_form.gsp
The plugin overrides some important files that could already exist:You can generate each artifact with the following commands:For this reason, use the create-views command carefully if you are working on an existing application.
grails-app/views/index.gsp
src/templates/scaffolding/_form.gsp
src/templates/scaffolding/renderEditor.template
.
File | Command |
---|---|
Home controller | create-home |
Index artifacts (index , _header , _topMenu and _menu ) | create-views-index |
Templates (_content , _list and _form ) | install-optimus-templates |
grails-app/views/person/_content.gsp | create-content-template |
grails-app/views/person/_list.gsp | create-list-template |
grails-app/views/person/_form.gsp | create-form-template |