Last active
September 8, 2020 16:46
-
-
Save thijsnado/a81a42caaeffaf5b951a to your computer and use it in GitHub Desktop.
Example of ActiveModel::Serializer selectively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
gem 'active_model_serializers', require: false | |
# config/initializers/active_model_serializers.rb | |
require "active_model" | |
require "active_model/serializer/version" | |
require "active_model/serializer" | |
require 'action_controller/serialization' | |
# in controller where you want to use active model serializer | |
class SomeController < ApplicationController | |
include ::ActionController::Serialization | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No worries. Can't believe that you actually found this 😆