I started with simple, concrete hypermedia for Objectives. For the collection I created a collection
method, into which I passed the Objectives to create a collection+json
object. For a single record, I loop through its associations with reflect_on_all_associations
, and create links to all its associated objects.
I then moved this logic to ApplicationController and abstracted it for use with Indicators.
Namespaces in this hackery were a little tricky: self_link
could theoretically mean either:
{"rel": "self", "href": "/path/to/self"}