when backbone app was loaded(for my app it means the page loaded),I need the initial collection data, and backbone docs says:
<script>
var accounts = new Backbone.Collection;
accounts.reset(<%= @accounts.to_json %>);
var projects = new Backbone.Collection;
projects.reset(<%= @projects.to_json(:collaborators => true) %>);
</script>
I don't understand this. Dose it mean I should render the page with the initial data like
{{collection_initial_data}}
I am using django on backends, so how do I translate the above code into django template, something like
<script>
var accounts = new Backbone.Collection;
accounts.reset({{ @accounts.to_json }});
var projects = new Backbone.Collection;
projects.reset({{ @projects.to_json(:collaborators => true) }});
</script>
anyway I am really confused about getting the initial data of backbone collection.