message = {
message_type: "renew",
id: "123"
}
ActionCable.server.broadcast('messages', message.to_json)
App.messages = App.cable.subscriptions.create('MessagesChannel', {
received: function(data) {
var jsonObj = JSON.parse(data);
var objId = jsonObj.id;
if (jsonObj.message_type == "renew") {
window.location.href = "/zalupa/" + objId;
}
}
});
var jsonObj = JSON.parse(data);
$('#events').append '<h1>' + jsonObj.name + '</h1>' + '<p>' + jsonObj.description + '</p>'
App.messages = App.cable.subscriptions.create('MessagesChannel', {
received: function(data) {
var jsonObj = JSON.parse(data);
if (jsonObj.message_type == "zalupa") {
}