mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Update SerializableResource documentation (#1977)
Mention that ActiveModelSerializers::SerializableResource.new can be used for single resource as well as for collections
This commit is contained in:
@@ -19,6 +19,7 @@ serializable_resource = ActiveModelSerializers::SerializableResource.new(post, o
|
||||
# Convert your resource into json
|
||||
model_json = serializable_resource.as_json
|
||||
```
|
||||
The object that is passed to `ActiveModelSerializers::SerializableResource.new` can be a single resource or a collection.
|
||||
|
||||
### Looking up the Serializer for a Resource
|
||||
|
||||
|
||||
Reference in New Issue
Block a user