Remove url options

Removing url options because It does not works at all.
Thus, there are others PR at the moment to include url(links) as well.
This commit is contained in:
Bruno Bacarini
2015-09-07 12:13:19 -03:00
parent f149e5084b
commit 8634503849
5 changed files with 0 additions and 55 deletions

View File

@@ -36,8 +36,6 @@ class PostSerializer < ActiveModel::Serializer
attributes :title, :body
has_many :comments
url :post
end
```
@@ -48,8 +46,6 @@ class CommentSerializer < ActiveModel::Serializer
attributes :name, :body
belongs_to :post
url [:post, :comment]
end
```
@@ -239,8 +235,6 @@ class PostSerializer < ActiveModel::Serializer
has_many :comments
has_one :author
url :post
end
```
@@ -251,8 +245,6 @@ class CommentSerializer < ActiveModel::Serializer
attributes :name, :body
belongs_to :post_id
url [:post, :comment]
end
```
@@ -274,8 +266,6 @@ And you can change the JSON key that the serializer should use for a particular
has_many :comments, key: :reviews
```
The `url` declaration describes which named routes to use while generating URLs
for your JSON. Not every adapter will require URLs.
## Pagination
Pagination links will be included in your response automatically as long as the resource is paginated using [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate) and if you are using a ```JSON-API``` adapter.
@@ -307,8 +297,6 @@ class PostSerializer < ActiveModel::Serializer
attributes :title, :body
has_many :comments
url :post
end
```
@@ -332,8 +320,6 @@ class PostSerializer < ActiveModel::Serializer
attributes :title, :body
has_many :comments
url :post
end
```