Skin Loader
Dependency :
compile ":skin-loader:1.0.9"
Summary
A simple plug-in which provides the ability to load "skin" into your application or plug-in.
Installation
Installation
To install the Grails Skin Loader plug-in type in this command in your project's root folder:grails install-plugin skin-loader
If you're modifying an existing application, backup any scaffolding templates you've already established now; you can use them later but you'll want to see how it looks first.
Usage
Grails Skin Loader comes with basic scaffolding views that replace the core grails scaffolding view templates. To install these, run the following command:grails load-skin
Available skins
Currently the following skins are provided:- remote-forms - makes use of prototype and script.aculo.us and the existing remote form tags provided by Grails. Allows the forms generated through scaffolding to be Ajax driven.
Changing skins
You can change the view skins currently used by the application, simply invoke the same load-skin command along with the new skin name:grails load-skin <skinname>
Creating a skin
When creating a skin, I recommend providing enough templates such that it can stand alone. You may want to package up your rendering templates into a skin that you can reuse across applications; currently these can then be used by other applications by placing them in the skins directory of the plug-in after installing the plug-in.Removing a skin
If you don't have a need for a given skin, you can blow it away from the skins directory.Quick-start walk through
The following assumes you're using Grails 1.2.0+.
- Create an application and install skin-loader.
grails create-app sample cd sample grails install-plugin skin-loader grails load-skin remote-forms
- Create a Book class.
grails create-domain-class Book
- Add a name property to the Book
class Book {
String name
}- Now generate your controller and views.
grails generate-all Book
- Run your app, and check out the various views.
grails run-app
- Enjoy!
Upgrading from an earlier release
There shouldn't be any issues upgrading from an earlier release. You'll need to blow away the older skin-loader plugin directory, as usual.Tips
- Sometimes you might find it necessary to run a grails clean in order to eliminate a view you created that has been copied to the WEB-INF directory but which no longer exists in your views / scaffold.
- Sometimes you might find it necessary to clean up the plug-in installation if the scaffolding you used before leaves some files behind. This will be improved upon in a future release.