File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ model_json = serializable_resource.as_json
22
22
23
23
### Looking up the Serializer for a Resource
24
24
25
- If you want to retrieve a serializer for a specific resource, you can do the following:
25
+ If you want to retrieve the serializer class for a specific resource, you can do the following:
26
26
27
27
``` ruby
28
28
# Create our resource
@@ -41,7 +41,13 @@ You could also retrieve the serializer via:
41
41
ActiveModelSerializers ::SerializableResource .new (post, options).serializer
42
42
```
43
43
44
- Both approaches will return an instance, if any, of the resource's serializer.
44
+ Both approaches will return the serializer class that will be used for the resource.
45
+
46
+ Additionally, you could retrieve the serializer instance for the resource via:
47
+
48
+ ``` ruby
49
+ ActiveModelSerializers ::SerializableResource .new (post, options).serializer_instance
50
+ ```
45
51
46
52
## Serializing before controller render
47
53
You can’t perform that action at this time.
0 commit comments