Update serializers.md

This commit is contained in:
Akiicat 2017-02-28 05:23:19 +08:00 committed by GitHub
parent 6fbf59fdd0
commit 19f8ada4af

View File

@ -225,10 +225,10 @@ With the `:json` adapter, the previous serializer would be rendered as:
link :self do
href "https://example.com/link_author/#{object.id}"
end
link :author { link_author_url(object) }
link :link_authors { link_authors_url }
link(:author) { link_author_url(object) }
link(:link_authors) { link_authors_url }
link :other, 'https://example.com/resource'
link :posts { link_author_posts_url(object) }
link(:posts) { link_author_posts_url(object) }
```
#### #object