ruby - When rendering json in rails, how can I exclude an entry from an included association? -
i have following line...
render json: { user: @user.as_json(except: :password_digest, include: :currency), token: token}
however, except
element included currency association. how can this?
render json: { user: @user.as_json( except: :password_digest, include: { currency: { except: :your_element } } ), token: :token }
Comments
Post a Comment