Skip to content

Instantly share code, notes, and snippets.

@8bitDesigner
Created June 2, 2014 18:07
Show Gist options
  • Select an option

  • Save 8bitDesigner/5ce874349b4901595a06 to your computer and use it in GitHub Desktop.

Select an option

Save 8bitDesigner/5ce874349b4901595a06 to your computer and use it in GitHub Desktop.
videos = new Videos() # Create a collection of videos
videos.fetch() # Populate it with data from the server
videos.upload() # Create a new video
videos.fetchS3Credentials() # Possibly a private method? Applies to the resource as a whole
videos.models # Array of Video model instances
video = new Video(slug) # Create a new video instance for a specific video
video.fetch() # Fetch the model's data from the server
video.destroy() # Delete the model
video.set({attrs: 'here'}) # Update the model's attributes
video.save() # Save changes to the model
@8bitDesigner

Copy link
Copy Markdown
Author

Oh and videos.models[0] instanceof Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment