MediaType Collections: documentation

7 views
Skip to first unread message

Josep Blanquer

unread,
Sep 16, 2014, 11:13:24 PM9/16/14
to praxis-de...@googlegroups.com
All,

 Just a heads up that we've finally merged an outstanding PR to the docs that documented
how the existing MediaTypeCollections work. This feature was already in the codebase since 0.9, but it was not explicitly documented in our reference docs.

 I believe this is a very important and useful feature when dealing with media_types that have 
related collections of other media_types. This rounds up our overall MediaType support so you can work with cases where you want to expose relationships to collections of media_type elements in different ways:
  1. by embedding the full contents of the collection within an attribute. For example, exposing an array of posts (each fully rendered according to a Post view) in the 'posts' attribute of a Blog.
  2. by embedding just aggregate information about the collection within an attribute. For example, exposing a hash with elements like 'count', 'last_published_date', in the 'posts' attribute of a Blog.
  3. by simply providing a link to the collection in the links section. Providing an 'href' attribute (and perhaps other annotations) in the 'posts' attribute inside the 'links' section of a Blog.
Feel free to take a look at the Collections section of the MediaTypes reference docs. 

Any feedback is welcome! Cheers,

 Josep M.
Reply all
Reply to author
Forward
0 new messages