3 ms·
I suppose this is okay, but it can quickly become a mess as soon as you need to make the modified portion of the dom interactive: $('#messages').prepend('<
by jcampbell1 13y ago
I suppose this is okay, but it can quickly become a mess as soon as you need to make the modified portion of the dom interactive:
$('#messages').prepend('<%=j render @message %>')
.find('.delete').click(fn)
.end().find('.reorder').hover(fn,fn)
I suppose they work around this problem with event delegation.
If you use something like angular, the whole mess becomes:
$scope.messages.unshift(message);
- artellectual 13y agoactually there is a gem that solves that problem if you want to use SJR https://github.com/xpdr/transponder https://github.com/xpdr/transponder http://kontax.herokuapp.com/ http://kontax.herokuapp.com/ - example app running on heroku http://github.com/xpdr/kontax http://github.com/xpdr/kontax - example app on github