News for hackers. Stuff that matters.
Re:Rails in Realtime - How LayerVault updates every page in ... by davemo on Wednesday September 05, 2012 @11:19PM (#4482695)
As someone relatively new to Rails who is working on a "near" realtime system this was great, thanks for the article.

Wanted to point out that you can simplify your "folder count updating" code by using a relatively unused jQuery function: ".load" [1].

  $.get($section.attr('data-url'))
    .success(function (response) {
      $section.html(response);
    });
would become

  $section.load($section.data('url'));
[1] http://jqapi.com/#p=load

There are no comments on this comment yet.