Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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);


actually there is a gem that solves that problem if you want to use SJR

https://github.com/xpdr/transponder

http://kontax.herokuapp.com/ - example app running on heroku

http://github.com/xpdr/kontax - example app on github




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: