Update README to reflect override of json key in associations

This commit is contained in:
Chris Ball 2013-10-26 10:00:45 -04:00
parent d5308b4d0b
commit 3b9b4d728a

View File

@ -386,7 +386,7 @@ class PostSerializer < ActiveModel::Serializer
attributes :id, :title, :body attributes :id, :title, :body
# look up comments, but use +my_comments+ as the key in JSON # look up comments, but use +my_comments+ as the key in JSON
has_many :comments, key: :my_comments has_many :comments, root: :my_comments
end end
``` ```