2
我運行一個Rails 4.2 - 0.9 AMS的應用程序,和我有(用於說明目的)3種型號:Foo
HAS_ONE Bar
,的has_many Baz
ES。我只在響應中獲得ID,而不是側裝項目。有沒有配置選項,或者我錯過了什麼?::加載ActiveModel串行器嵌入:IDS,包括:真不是側面加載數據
我AMS類是:
class FooSerializer < ActiveModel::Serializer
embed :ids, include: true
has_one :bar, key: :bar ## For ember-data; it doesn't like "_id"
has_many :bazes, key: :bazes
attributes :id, :etc
end
整個StackOverflow上有是在AMS相當多的話題,我在發佈前看了很多,但是這個剛剛離開我完全難倒。