Open lleger opened 7 years ago
It looks like we either never had support for this or lost it at some point. I will get this in the next release.
I'm pretty sure this never existed but here are a couple ideas:
For non-DSL version it'd probably be easy to do something like this:
def links(data, conn) when is_list(data) do
# ...
end
def links(data, conn) do
# ...
end
For DSL version we could either offer a second function:
location "/articles/:id"
collection_location "/articles"
or add a function that takes both:
locations collection: "/articles", resource: "/articles/:id"
I see there's an easy way to add links to an object via the
location
DSL or thelinks
callback, but this only adds links to individual resources. Is there a way to add links to the top-level of a collection? For example, how can I do this: