Skip to content

Instantly share code, notes, and snippets.

@awalker
Created December 21, 2011 21:58
Show Gist options
  • Save awalker/1507911 to your computer and use it in GitHub Desktop.
Save awalker/1507911 to your computer and use it in GitHub Desktop.
How to request a single record from an AJAX endpoint with Spine.js.
###
``Battleship`` is your model and ``id`` is the record id.
This requests the record rather than all records.
It could be used it places where loading a single record is
required but no natual scoping is available.
###
Battleship.ajax().find(id).success (record) ->
Battleship.refresh(record)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment