Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

menisy's Profile

GitHub User: menisy

Comments by

Avatar

even better,

<% publish_to "/messages/new" do %>
$("#chat").append("<%= escape_javascript render(@message) %>");
$("#chat").animate({ scrollTop: $("#chat").height() }, "fast");
<% end %>

This second line makes sure that the scroll is animated to the bottom so that it shows the newly appended message!