Skip to content

Instantly share code, notes, and snippets.

@richardsondx
Last active August 29, 2015 13:57
Show Gist options
  • Save richardsondx/9517807 to your computer and use it in GitHub Desktop.
Save richardsondx/9517807 to your computer and use it in GitHub Desktop.
class JirasController < ApplicationController
def generate_work_log
...
fields.each_with_index do |field,index|
progress = field.index
WebsocketRails[:admin_channel].trigger :event_name, progress
end
end
end
<script>
jira = {}
var dispatcher = new WebSocketRails('localhost:3000/websocket');
dispatcher.bind('event_name', function(data) {
console.log(data.message) // would output 'this is a message'
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment