Last active
August 29, 2015 13:57
-
-
Save richardsondx/9517807 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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