Skip to content

Instantly share code, notes, and snippets.

@mbailey
Created February 20, 2011 02:42
Show Gist options
  • Save mbailey/835631 to your computer and use it in GitHub Desktop.
Save mbailey/835631 to your computer and use it in GitHub Desktop.
## Encode
json = ActiveSupport::JSON.encode(object) # extra methods like :include
json = Offering.first.to_json(:include => :outlet, :methods => [:days_waiting])
## Decode
ActiveSupport::JSON.decode(json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment