{"comment":{"created_at":"2011-10-19T03:37:40Z","body":"I think the only way forward is to basically either take the haml approach or split it up in https://github.com/nesquena/rabl/blob/master/lib/rabl/template.rb even further creating a separate handler for 3.1 following https://github.com/stevegraham/twilio-rb/pull/12 example","updated_at":"2011-10-19T03:37:40Z","url":"https://api.github.com/repos/nesquena/rabl/issues/comments/2451719","id":2451719,"user":{"gravatar_id":"e8a84c62048ccb7ee08d4fdeb6417533","avatar_url":"https://secure.gravatar.com/avatar/e8a84c62048ccb7ee08d4fdeb6417533?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/nesquena","id":6511,"login":"nesquena"}},"action":"created","issue":{"number":42,"created_at":"2011-06-15T18:17:01Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"In the backbone.js FAQ, Jeremy suggests bootstrapping a backbone.js model by using ERB and converting the object/collection to json:\r\n\r\n```javascript\r\n<script>\r\n  Accounts.refresh(<%= @accounts.to_json %>);\r\n  Projects.refresh(<%= @projects.to_json(:collaborators => true) %>);\r\n</script>\r\n```\r\nhttp://documentcloud.github.com/backbone/#FAQ-bootstrap\r\n\r\nHow could I render a rabl template in the view instead of calling to_json on the object/collection?","comments":36,"title":"Render Rabl templates from view (in order to bootstrap a backbone.js model)","updated_at":"2011-10-19T03:37:40Z","url":"https://api.github.com/repos/nesquena/rabl/issues/42","id":1062839,"assignee":null,"milestone":null,"closed_at":"2011-07-21T19:49:25Z","user":{"gravatar_id":"05d674b2b03b5d47c9780fd090aecbfb","avatar_url":"https://secure.gravatar.com/avatar/05d674b2b03b5d47c9780fd090aecbfb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/scottmessinger","id":100121,"login":"scottmessinger"},"html_url":"https://github.com/nesquena/rabl/issues/42","labels":[],"state":"closed"},"legacy":{"issue_id":1062839,"comment_id":2451719}}