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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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