This app demonstrates how to bootstrap JSON data from ERB templates into a Backbone app.
This is done by dumping JSON into a <script>
tag on posts/index.html.erb
,
then loading the data into a Backbone collection to be rendered by a Backbone
view.
Bootstrapping data to the view and using Backbone to display it is a quick way of integrating Backbone into an app that currently doesn't use it. Why? Because it requires no change from the controllers to expose an API. By reading JSON from the page, it becomes very simple to use pieces of Backbone (models, collections, views) without AJAX requests or routers; those can come later.
$ bin/setup
$ docker-compose up web
$ docker-compose run web rake db:bootstrap
$ docker-compose run web rake
See the LICENSE