padcom/grails-json-rest-api — pull request #18 by kentbutler (2013-03-06 10:58:43+00:00)
Title: support emberjs

Hello Matthias -
This is my first time doing this; if it is not clear, you should be seeing the 'emberjs-support' branch and not 'master'.

I liked your plugin for its simplicity, power, and name. So I chose to use it for providing a REST backend for working with some of the modern JS frameworks, starting with EmberJS.

It had a couple small problems for this though:
* the JSON data units could only be labeled with 'data'
- i.e. `{data:{name:'Test'}}`

* plugin could not recognize incoming requests using plural form of the entity name
- i.e. `http://localhost/test/api/persons`

* the result JSON would always contain some extra fields such as 'success' and 'count'
- this made EmberJS barf

This immediately rendered the plugin incompatibile with EmberJS. Considering your plugin worthy of up-building, I set out in that direction. I made efforts to keep the default plugin state operating exactly as it does now. For that reason I added functional tests in the form of a generic Mixin class that can be added to any project that uses this plugin - [see my TodoMVC project for an example](https://github.com/kentbutler/todomvc-grails-emberjs).

I also updated the related grails-json-rest-api-examples project, [in this fork](https://github.com/kentbutler/grails-json-rest-api-examples/tree/emberjs-support), just to make sure they still ran without having to change anything.

I have tried to make the README.md file more descriptive. The sample TodoMVC application (link above) also has a README.md that explains how to run it and see the REST output.

Thanks -
Kent Butler