GitHub User: buhrmi
The code I wrote above, however, contains a bug that would reset the input field for all users.
class MessageController < ApplicationController
# some logic here
publish_to @message.channel do
jQuery('#messages').append render @message
jQuery('#new_message_text').val '' if @message.user_id == current_user_id