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

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -