Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : CanJS works well with the Rails asset pipeline

$
0
0
This is an interesting technique that sort of works for me, except for a few (rather important) things:

- server side EJS doesn't recognize canjs's EJS helpers, I am forced to declare
  1. window.list = can.EJS.Helpers.prototype.list
to get this to work. Come to think of it, I haven't yet checked if the actual live binding works if you do it this way. Is this the right way or do I need to 'include' the helpers some other way?

- how do you get element callbacks to work? My server doesn't know what to do with e.g:
  1. <div class='item' <%= (el)-> el.data('item', item) %> ></div>
or the classic version
  1. <div class='item' <%= function(el){ el.data('item', item)} %> ></div>
since this is code that is supposed to be run at runtime of course. How do you do this when precompiling the js?

Thanks,
Michel


Viewing all articles
Browse latest Browse all 3491

Trending Articles