Created
August 31, 2012 15:26
-
-
Save jeroenr/3554578 to your computer and use it in GitHub Desktop.
Use ERB template to pass rendered HTML to backbone router (BLEHHH)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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