{"comment":{"created_at":"2011-10-19T04:17:16Z","body":"Ok, I've made some progress on this:\r\n\r\nIt's nothing to do with the HAML bug. The problem is that render() in Engine is getting \"html\" in self.request_format... when it should be \"json\". A temporary fix looks like this: https://gist.github.com/1297460\r\n\r\nCheck out line 17 - if we manually force the format to \"json\" this works as expected.\r\n\r\nIn the Rails 2 version, the format is being set using \r\n```ruby\r\n{ :format => #{template.format.inspect} }\r\n```\r\n\r\nformat is a private method on ActionView::Template in Rails 3, so we can't do this anymore.\r\n\r\nThoughts?","updated_at":"2011-10-19T04:17:16Z","url":"https://api.github.com/repos/nesquena/rabl/issues/comments/2451874","id":2451874,"user":{"gravatar_id":"78b17d58791976b82b7b986228cbfe95","avatar_url":"https://secure.gravatar.com/avatar/78b17d58791976b82b7b986228cbfe95?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/willrjmarshall","id":97204,"login":"willrjmarshall"}},"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":37,"title":"Render Rabl templates from view (in order to bootstrap a backbone.js model)","updated_at":"2011-10-19T04:17:16Z","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":2451874}}