Skip to content

Instantly share code, notes, and snippets.

@thomasboyt
Created August 22, 2013 03:21
Show Gist options
  • Select an option

  • Save thomasboyt/6302864 to your computer and use it in GitHub Desktop.

Select an option

Save thomasboyt/6302864 to your computer and use it in GitHub Desktop.
post = models.Post.build({
title: 'first post'
date: Date.now()
body: 'This is an autogenerated post'
})
post.save().error((err) ->
console.log 'Error while saving: ' + err
).success(() ->
console.log 'Saved properly'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment