Created
March 30, 2014 23:58
-
-
Save ghempton/9882197 to your computer and use it in GitHub Desktop.
EPF Adapter URL API
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
Adapter.map(function() { | |
this.resources('post', {path: '/blog-posts/:post_id'}, function() { | |
this.resources('comments'); // assumes has-many called 'comments' and inverse called 'post' | |
this.resource('owner', {type: 'user'}); | |
}); | |
}); | |
session.create('comment', {post: post}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like the create syntax, but what about find?
For example:
would be interpreted as a
findQuery
. My suggestion is to have the any find on a nested resource raise an exception and make people use@session.find('post', 1).get('comments')
instead.