所有用户都有一个个人资料。
目前有:
render :json => @user, :include => [:friends, :requested_friends]
想要为朋友和所请求的朋友添加个人资料。
我知道单个包含我可以使用此
render :json => @user, :include => {:requested_friends => {:include => :profile}}
但需要像:
render :json => @user, :include => {[:friends, :requested_friends] => {:include => :profile}}
答案 0 :(得分:1)
怎么样:
render :json => @user,
:include => {
:requested_friends => { :include => :profile },
:friends => { :include => :profile }
}