Tuesday, 15 September 2015

ruby - Sinatra Backbone Haml JST Templates -



ruby - Sinatra Backbone Haml JST Templates -

so downloaded coffee sinatra boilerplate repo (https://github.com/timwingfield/backbone-sinatra-boilerplate) starting point playing around both backbone , sinatra.

a lot of past ruby experience i'd used haml templating/markup language, decided setup haml repo.

i replaced file views/templates/title.jst.tpl views/templates/title.jst.haml, , added haml.js file js vendor folder, specifying dependency in server.rb deal undefined: haml not function error.

now error i'm trying deal is

uncaught typeerror: undefined not function pointing @ return c["templates/title"].apply(this, arguments); in outputted jst.js:

(function(){ var c = {}; if (!window.jst) window.jst = {}; jst["templates/title"] = function() { if (!c["templates/title"]) c["templates/title"] = (haml.compile("%h2 blog\n")); homecoming c["templates/title"].apply(this, arguments); }; })();

any suggestions?

it turns out there issue gem, switching (currently pending) pull request (https://github.com/rstacruz/sinatra-backbone/pull/12) fixes error i'm getting.

ruby backbone.js sinatra haml jst

No comments:

Post a Comment