From b55fc32ba25857c88d5b91d2158026a2f444ee26 Mon Sep 17 00:00:00 2001 From: Leandro Cesquini Pereira Date: Wed, 3 Feb 2016 10:22:17 -0200 Subject: [PATCH] improve doc as suggested by @bf4 --- docs/howto/add_top_level_links.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/howto/add_top_level_links.md b/docs/howto/add_top_level_links.md index a61775d2..bcb0ea18 100644 --- a/docs/howto/add_top_level_links.md +++ b/docs/howto/add_top_level_links.md @@ -3,7 +3,13 @@ JsonApi supports a [links object](http://jsonapi.org/format/#document-links) to be specified at top-level, that you can specify in the `render`: ```ruby - render json: @posts, links: { "self": "http://example.com/api/posts" } + links_object = { + href: "http://example.com/api/posts", + meta: { + count: 10 + } + } + render json: @posts, links: links_object ``` That's the result: @@ -23,7 +29,10 @@ That's the result: } ], "links": { - "self": "http://example.com/api/posts" + "href": "http://example.com/api/posts", + "meta": { + "count": 10 + } } } ```