Created
January 29, 2019 16:57
-
-
Save MartianLee/350a1e15e5799bf37db6006b505f05f3 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
App.dashboard = App.cable.subscriptions.create({ channel: "PollDashboardChannel", meeting_id: meeting_id, stage_item_type: 'Poll', stage_item_id: poll_id }, { | |
received: function(data) { | |
..... | |
switch(data.action) { | |
...... | |
case 'destroy': | |
...... | |
break; | |
case 'update_user_image': | |
$('.vote').each(function(index, elm){ | |
if($(elm).data('user-id') == data.user_id){ | |
$(elm).css({'background-image': 'url(' + data.image_path + ')'}); | |
} | |
}); | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment