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.groovygrails-app/views/home/_index.gspgrails-app/views/index.gspgrails-app/views/_header.gspgrails-app/views/_topMenu.gspgrails-app/views/_menu.gsp
src/templates/scaffolding/_content.gspsrc/templates/scaffolding/_list.gspsrc/templates/scaffolding/_form.gspsrc/templates/scaffolding/renderEditor.template
mypackage.Person, the plugin will generate the following files:
grails-app/views/person/_content.gspgrails-app/views/person/_list.gspgrails-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.gspsrc/templates/scaffolding/_form.gspsrc/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 |