Created
December 21, 2011 21:58
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
``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