I am using an action cable to create notifications in my application. The notification area was created based on this guide . The question is: how can I split user notifications? so that notifications are sent to each user individually. I am using rails 4.2.6 withgem 'actioncable'
gem 'actioncable'
I also get this error on the route mount ActionCable.server => '/cable'when trying to start the server:
mount ActionCable.server => '/cable'
/config/routes.rb:9:in `block in ': uninitialized constant ActionCable (NameError)
and this error when I try to create a chanel
Thank!
, Rails 5, , .
, , UserChannel stream_for, :
stream_for
class UserChannel < ApplicationCable::Channel def subscribed stream_for current_user end end
, , :
user = User.find(params[:id]) UserChannel.broadcast_to(user, { notification: 'Test message' })
Source: https://habr.com/ru/post/1695976/More articles:How to create complex XML using Spark-Xml - apache-sparkError in phpMyAdmin after updating to version 4.0: $ cfg ['TempDir'] (./tmp/) is unavailable - linuxextract sequences from multifasta file by ID in file using awk - searchThe limit of Laravel's eloquence in a relationship that relates - mysqlПечать последовательности из файла fasta - bashПодключить ETIMEDOUT в Azure App Service при вызове конечной точки HTTP без указания maxSockets - node.jsHow do JUnit masks check exceptions? - junit5Python / Kivy: selection bar in RecycleView using the Up and Down keys - python-2.7Как сделать всплывающее окно с изображениями на клике в формате datatable? - rИспользуйте AWK для поиска по файлу fasta, учитывая второй файл, содержащий имена последовательностей - awkAll Articles