###If I'm just sending JSON back and forth, why do I need Rails?
Rails is a rich HTTP abstraction, handles a lot for you
Read the HTTP spec
##ActionDispatch
###Middleware
Handles a lot for you -- Sessions, cookies, security, caching, MIMEs
- Handlebars.js
##JSON APIs
- Nesting child resources are up to you
- Naming keys is up to you
- Error reporting formatting is up to you
##Rules for APIs
- Root contains 1 or more keys
{
posts : {
...
}
}
- No nested resources (by URL -- use params instead)
- Nested objects should be the same
- When using nested objects, use array of hashing containing objects, or array of ints with ids
//GET /posts/bulk?ids=1,2
{
posts: [
{id : 1 . . . },
{id : 2 . . . }
]
}