This commit is contained in:
Yan
2017-12-14 17:08:08 +06:30
parent 36a30e73ab
commit e90d4d59ee
2 changed files with 20 additions and 21 deletions

View File

@@ -6,9 +6,8 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
disconnected: function() {},
received: function(data) {
if((data.table != undefined) && (data.table.length > 0)){
$.each(data.table,function(key,value){
console.log(value.table_id);
// console.log(value.table_id);
if($('.table_'+value.table_id).hasClass('blue')){
$('.table_'+value.table_id).removeClass('blue');
$('.table_'+value.table_id).addClass('orange');
@@ -23,8 +22,6 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
}
$('.new_text_'+value.table_id).removeClass('hide');
});
}
}
});

View File

@@ -3,8 +3,10 @@ class CheckinJob < ApplicationJob
def perform()
table = DiningFacility.get_checkin_booking
if table.length > 0
ActionCable.server.broadcast "checkin_channel",table: table
end
end
end