我有以下一行......
render json: { user: @user.as_json(except: :password_digest, include: :currency), token: token}
但是,我想except
来自所包含货币关联的元素。我怎么能这样做?
答案 0 :(得分:3)
render json: { user: @user.as_json( except: :password_digest,
include: { currency: { except: :your_element } } ), token: :token }