rails/jbuilder — pull request #62 by kunalmodi (2012-09-20 00:36:25+00:00)
Title: add option to ignore keys with nil values from generated json

I often want to ignore sending json keys with null values (this is useful for the JSON iOS library we use, which makes us check every value to ensure it is not nil). This adds an ignore_nil method in a similar fashion to key_formatter. You can globally ignore nil values by running `Jbuilder.ignore_nil` and within specific templates with `json.ignore_nil!`.