Sha256: 41d57b0628d94c96c4f0ddf350e4353473dac71a2804ae8169213cfddd8461e4

Contents?: true

Size: 780 Bytes

Versions: 3

Compression:

Stored size: 780 Bytes

Contents

<%= javascript_include_tag 'socket.io' %>
<%= javascript_include_tag 'push_routes_socket_io' %>
<p id="result"></p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
PushRoutes.connect({
	id: 1,
	authentication_token: "jLYFiT2ASngnaSKx1TsV", 
	callback: function() {
   	PushRoutes.subscribe("/people", function(data) {
   		console.log("Updating");
   		update();
   	});
   }
});
function update() {
	$.get( "/people", function( data ) {
		text = JSON.stringify(data);
	  $( "#result" ).html(text);
	});
}


PushRoutes.subscribe("/nested_route/2", function(data) {
   console.log("updating!");
   $.get( "/nested_route/2", function( data ) {
      text = JSON.stringify(data);
     $( "#result" ).html(text);
   });
});
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_routes-0.0.8 test/dummy/app/views/sockets/test.html.erb
push_routes-0.0.7 test/dummy/app/views/sockets/test.html.erb
push_routes-0.0.6 test/dummy/app/views/sockets/test.html.erb