Skip to content

Instantly share code, notes, and snippets.

@kenelliott
Created October 30, 2013 18:03
Show Gist options
  • Save kenelliott/7237200 to your computer and use it in GitHub Desktop.
Save kenelliott/7237200 to your computer and use it in GitHub Desktop.
foo = "bar"
data = [
id:1
name: "bat"
,
id: 2
name: "baz"
]
# how can I interpolate foo into this data structure?
thing = foo: data
# foo should equal bar, which is the value of the variable.
thing = {foo: [{id:1,name:"bat"},{id:2,name:"baz"}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment