Brainstem is a presenter and API library for Rails. Brainstem.js is a library for Backbone.js that adds the concept of relational models and makes working with Brainstem APIs easy.
This demo project shows off some of the features of Brainstem and Brainstem.js.
rake db:create db:migrate
rake db:seed
rails s
Then visit localhost:3000 to play with the app.
- To get started with Brainstem in Rails, take a look at config/initializers/brainstem.rb.
- From there, skim the example presenters in lib/api/v1.
- Finally, check out the API controllers in app/controllers/api/v1.
- All of the Backbone code is in app/assets/javascripts/backbone.
- Start by skimming the models, then
- checkout how we setup the base application in application.js.coffee.
- Finally, checkout the views and eco templates to see Brainstem.js in action.
Find a bug? Have an idea about how to expand this demo? Send us a pull request!
This demo, Brainstem, and Brainstem.js are available under the MIT License.