/backbone

A GRAILS resource plugin for using backbone in a project

Primary LanguageJavaScript

Grails Backbone Plugin

A simple resource plugin to get started with backbone.js in your Grails project. For more information on backbone, please see: backbone and underscore

Installation

Due to an issue with the (at the time of writing) grails 2.0.0.RC1 release, the yui-minifiy-resources plugin dependency isn’t resolved correctly see

To Install:

> cd {your_project_root}
> grails install-plugin yui-minify-resouces
> grails install-plugin backbone

Using Backbone in your project

This plugin uses grails resources. To include the necessary backbone resources, add the following to your page headers (or to your layouts if that is more appropriate).

<r:require modules='backbone'/>

This plugin also makes use of the ‘yui-minify-resources’:http://www.grails.org/plugin/yui-minify-resources plugin. For ease of debug, the plugin uses the un-minified, and un-compressed libraries for backbone and underscrore and configures yui-minify-resources to minifiy during production. If you’d like to change this, simply set the following in the appropriate environment section of your Config.groovy file.

//Completely enable css and/or js processor for development
grails.resources.mappers.yuicssminify.disable=false
grails.resources.mappers.yuijsminify.disable=false

Write and organize your backbone related source as you see fit. In the future this plugin may offer conventional framework for backbone source organization.