Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jeroenr
Created August 31, 2012 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenr/3554578 to your computer and use it in GitHub Desktop.
Save jeroenr/3554578 to your computer and use it in GitHub Desktop.
Use ERB template to pass rendered HTML to backbone router (BLEHHH)
<div id="posts"></div>
<script type="text/javascript">
$(function() {
// Blog is the app name
window.router = new Blog.Routers.PostsRouter({posts: <%= @posts.to_json.html_safe -%>});
Backbone.history.start();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment