Open mrbrdo opened 12 years ago
I second this feature. It would be nice to be able to subscribe and unsubscribe, especially when you're working with full-JS front-end applications, like the ones you write in Backbone, Spine, Ember, Knockout, Knockback, Batman, Sproutcore, etc.
Being able to toggle between subscribe
and unsubscribe
would be a great addition, even if it means having to set the expiration to never. It should be safe enough when going over an HTTPS protocol I assume.
a hack:
:javascript
if(!$(window).data("connected")){
#{subscribe_to("/chat/#{@chat.id}").gsub('</script>', '').gsub('<script type="text/javascript">','')}
$(window).data("connected", true)
}
It seems unsubscribe functionality is missing. "sign"-ing twice to the same channel makes duplicate messages.