I am trying to record all the users who are currently online.
Here is what I tried:
In my "main.html":
{{store._online_users.each do |user| }}
{{user.to_h}} <br>
{{end}}
The problem is that at some point when I tested this, I got about a dozen entries in the list store._online_users. I want to delete them all, but I cannot get it to work. I tried:
store._online_users.clear has no effectstore._online_users.each(&:destroy) no effectstore._online_users = [] no effect
Edit
, , , Volt.current_user - , - auth.
store._online_users , .
, store._current_users :
channel.on('connect') {
Volt.current_user.then { |user|
unless user.nil?
store._current_users << user
end
}
}
channel.on('disconnect') {
Volt.current_user.then { |user|
unless user.nil?
store._current_users.delete(user)
end
}
}
ModelArray, -?