Skip to content

Commit 7489a11

Browse files
author
John Cordero
committed
serializers
1 parent a26efb0 commit 7489a11

29 files changed

+13
-0
lines changed

movies_api_full/Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gem 'webpacker', '~> 5.0'
1717
gem 'turbolinks', '~> 5'
1818
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
1919
gem 'jbuilder', '~> 2.7'
20+
gem 'active_model_serializers', '~> 0.10.0'
2021
# Use Redis adapter to run Action Cable in production
2122
# gem 'redis', '~> 4.0'
2223
# Use Active Model has_secure_password

movies_api_full/Gemfile.lock

+9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ GEM
3939
erubi (~> 1.4)
4040
rails-dom-testing (~> 2.0)
4141
rails-html-sanitizer (~> 1.1, >= 1.2.0)
42+
active_model_serializers (0.10.12)
43+
actionpack (>= 4.1, < 6.2)
44+
activemodel (>= 4.1, < 6.2)
45+
case_transform (>= 0.2)
46+
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
4247
activejob (6.1.3.1)
4348
activesupport (= 6.1.3.1)
4449
globalid (>= 0.3.6)
@@ -65,6 +70,8 @@ GEM
6570
msgpack (~> 1.0)
6671
builder (3.2.4)
6772
byebug (11.1.3)
73+
case_transform (0.2)
74+
activesupport
6875
concurrent-ruby (1.1.8)
6976
crass (1.0.6)
7077
erubi (1.10.0)
@@ -75,6 +82,7 @@ GEM
7582
concurrent-ruby (~> 1.0)
7683
jbuilder (2.11.2)
7784
activesupport (>= 5.0.0)
85+
jsonapi-renderer (0.2.2)
7886
listen (3.5.1)
7987
rb-fsevent (~> 0.10, >= 0.10.3)
8088
rb-inotify (~> 0.9, >= 0.9.10)
@@ -179,6 +187,7 @@ PLATFORMS
179187
ruby
180188

181189
DEPENDENCIES
190+
active_model_serializers (~> 0.10.0)
182191
bootsnap (>= 1.4.4)
183192
byebug
184193
jbuilder (~> 2.7)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class MovieSerializer < ActiveModel::Serializer
2+
attributes :id, :name, :rating
3+
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)