Nice episode. I did the same few days ago using PusherApp together with Rbjs. It cleans up the Serverside Javascript pretty much and I ended up simply writing:
ruby
classMessageController < ApplicationControllerdefmessage# 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
endendend
With a small little DSL that transforms into Javascript: https://github.com/buhrmi/rbjs
The code I wrote above, however, contains a bug that would reset the input field for all users.
Nice episode. I did the same few days ago using PusherApp together with Rbjs. It cleans up the Serverside Javascript pretty much and I ended up simply writing: