You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-14Lines changed: 0 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,6 @@ class PostSerializer < ActiveModel::Serializer
36
36
attributes :title, :body
37
37
38
38
has_many :comments
39
-
40
-
url :post
41
39
end
42
40
```
43
41
@@ -48,8 +46,6 @@ class CommentSerializer < ActiveModel::Serializer
48
46
attributes :name, :body
49
47
50
48
belongs_to :post
51
-
52
-
url [:post, :comment]
53
49
end
54
50
```
55
51
@@ -239,8 +235,6 @@ class PostSerializer < ActiveModel::Serializer
239
235
240
236
has_many :comments
241
237
has_one :author
242
-
243
-
url :post
244
238
end
245
239
```
246
240
@@ -251,8 +245,6 @@ class CommentSerializer < ActiveModel::Serializer
251
245
attributes :name, :body
252
246
253
247
belongs_to :post_id
254
-
255
-
url [:post, :comment]
256
248
end
257
249
```
258
250
@@ -274,8 +266,6 @@ And you can change the JSON key that the serializer should use for a particular
274
266
has_many :comments, key::reviews
275
267
```
276
268
277
-
The `url` declaration describes which named routes to use while generating URLs
278
-
for your JSON. Not every adapter will require URLs.
279
269
## Pagination
280
270
281
271
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
307
297
attributes :title, :body
308
298
309
299
has_many :comments
310
-
311
-
url :post
312
300
end
313
301
```
314
302
@@ -332,8 +320,6 @@ class PostSerializer < ActiveModel::Serializer
0 commit comments