apotonick/roar-rails — pull request #43 by mpeychich (2013-05-23 14:03:14+00:00)
Title: Hal rendering

What this pull request does:
- Improves the responder by moving the representer to `to_format` rather than `display` which seems like a better location.
- Adds the `application/json+hal` mime type and a default renderer for hal when you `require roar/rails/json_hal_renderer`.
- Defines ToHal module to add a `to_hal` method (just `to_json` under the hood) to the responder and extends the resource(s) and validation errors, allowing hal to respond with the default rails API behavior.
- Adds `:respresent_formats` to responder options. By default (not supplying it) you will represent all formats supported by the respond_with call. By specifying a format or an array of formats you are choosing to only represent those formats. This is useful when you have a legacy client hitting an endpoint for a JSON response and do not wish to extend/decorate it with a representer.