forked from ajnirp/rtalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.rb
26 lines (26 loc) · 764 Bytes
/
temp.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<script>
$("#leaveroom").popover({
placement: "bottom"
});
$("#help").popover({
placement: "bottom"
});
$("#export_chat_history").popover({
placement: "bottom"
});
<% publish_to room_path(@room)+'_user_list' do %>
//$("#userlist").append("<%= j render partial: 'rooms/user', locals: {user: current_user} %>")
<% end %>
PrivatePub.subscribe('<%= room_path(@room) + "_user_list_leaves" %>', function(data, channel) {
var name_to_delete = data.name;
var dom;
$("#userlist p").each(function(i,e){
if($(e).text() == name_to_delete) {
$(e).remove();
}
})
});
<% subscribe_to room_path(@room)+'_user_list_leaves' do %>
$("#userlist").append("<%= j render partial: 'rooms/user', locals: {user: current_user} %>")
<% end %>
</script>