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/
Written by Maedi
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#