Skip to content

Commit 73437d2

Browse files
authored
Update TODO.md
playground testing
1 parent afff6c4 commit 73437d2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

TODO.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,23 @@
33
1. Rails Serializers
44
2. JWT
55
3. Rack::Attack
6+
7+
8+
9+
# Rails Serializers
10+
11+
What are Serializers? Well Rails API's returns JSON data in full, so serializers allows us to cherry pick the exact data we want in a much organized fashion. Instead of getting every column from the returned data, we can grab which ever we allow to pass through.
12+
13+
| Normal Model | Serializer Model |
14+
| ------------- |:-------------:|
15+
| id, name, rating, director, score, actors_id, created_at, updated_at| id, name, rating|
16+
17+
We are able to tell the Rails API what to fetch rather than the frontend; making it much more simple and faster to scaffold your next project.
18+
19+
1. Installation
20+
21+
Open your ```gemfile``` and add the serializer gem into your project
22+
```ruby
23+
# Serializer
24+
gem 'active_model_serializers'
25+
```

0 commit comments

Comments
 (0)