Last Updated: February 25, 2016
·
966
· maedi

Rails to_json Options

:only – Only show column names in the output as specified in this list
:except – Show all column names except the ones specified in this list
:methods – Include these methods nodes (without any arguments) as nodes in the output
:include – Add child nodes (potentially nested) based on associations within the object

From: http://blog.thecodepath.com/2011/05/16/if-youre-using-to_json-youre-doing-it-wrong/