Skip to content

Instantly share code, notes, and snippets.

@ianpetzer
Last active December 17, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianpetzer/5656133 to your computer and use it in GitHub Desktop.
Save ianpetzer/5656133 to your computer and use it in GitHub Desktop.
User Serializer that includes Opinions
class UserSerializer < ActiveModel::Serializer
attributes :id, :name
embed :ids, include: :true
has_many :opinions
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment