Notes From a Full Stack Developer
on Rails, ActiveRecord, Hidden Attributes

Hidden Model Attributes

Sometimes we have some attributes of model that should not to be available for client (via json format, javascript variables...), such as: password, login count, secret token... When we do render json: @visitor, Rails will return to client like this: { id: 1, secret_token: "iHj-Psm45Ymge-7kZNyx", name: "Test
Read More