Questions tagged [actioncable]

Action Cable is an open source technology shipped to us with Ruby On Rails 5. It uses websockets instead of traditional HTTP protocol and allows 2-way asynchronious data transfer. The best field of application for ActionCable is chat, single page applications and so on.

Filter by
Sorted by
Tagged with
1 vote
1 answer
47 views

Rails 7/Action Cable: Access consumer instance from view

On Rails 7, I have created a channel called "SessionChannel". When my page loads, the consumer is being properly created as I can see the log show in the browser. This is my app/javascript/...
0 votes
0 answers
29 views

Create instance of a model remotely

I have a turns model that i want to create based off a card id and a user id, the user id is passed correctly, but the card id is nil. This is the card turbo frame <%= turbo_frame_tag "...
0 votes
0 answers
23 views

Using Standard Websockets in JS with Ruby on Rails Actioncable

How can I use a standard websocket connection in JS, to listen for broadcasts from a Ruby on Rails app? The app I am developing currently uses the unmaintained library actioncable-js-jwt to pass a JWT ...
0 votes
0 answers
22 views

Rails 6 cable Issue - "Successfully upgraded to WebSocket"

I have implemented a chat system with rails action cable. It works in production but doesn't work in my local system. Keep getting this message in logs Was trying to implement chat in rails 6 with ...
0 votes
0 answers
25 views

Websocket connection with rails 7 to external wss return only ping

I try to connect to a websocket server from my rails project and send a graphql susbcription query. I tried with different methods , but still have the same problem : I receive a welcome message and ...
  • 13
0 votes
0 answers
19 views

Actioncable: connect client to channel using only backend

Hello intelligent beings! I think about using only ruby to connect a client to an ActionCable channel. So that's without the client to send any request. Logically that should be possible, because if ...
  • 13
2 votes
1 answer
74 views

How to fix the warning: "DEPRECATION: action_cable.js has been renamed to actioncable.js – please update your reference before Rails 8"? (Rails 7.0.4)

I have a Ruby on Rails single page application using React as the front-end, and since we upgraded from Rails 6.1 to Rails 7.0, the warning "DEPRECATION: action_cable.js has been renamed to ...
2 votes
1 answer
36 views

React app listen for object mutation and execute action

Preface: I've googled this and can't find a solution that works for me. If there is a solution on stackoverflow, my search hasn't found it. I am using the actioncable-js-jwt library in React, and I am ...
1 vote
0 answers
64 views

Disable ActionCable broadcast for specific browser tab

I have a web application based on Rails v7.0.4 that typically runs in multiple browser tabs. When the user performs a certain action like logging out in one of the tabs, a confirmation dialog ...
  • 135
1 vote
1 answer
21 views

Secure Action cable with Doorkeeper Authorisation

I am working on ActionCable and implemented Doorkeeper Authorization in my rails application. I want to implement authenticate my client with Doorkeeper::AccessToken with ActionCable Here is how I ...
0 votes
0 answers
47 views

How do I turn on logging for ActionCable for Ruby on Rails? Cannot seem to get a websockets server running at all

So I'm new to Ruby on Rails. I've managed to get a basic website running, and I'm hosting it with Puma. I'm trying to integrate websockets stuff, and was following this guide here: https://guides....
  • 1
0 votes
1 answer
59 views

Broadcast message for identified user with ActionCable from non Rails application

I have action cable channel with identified user class DesktopNotificationsChannel < ApplicationCable::Channel def subscribed reject and return unless current_user.present? logger....
  • 245
0 votes
0 answers
78 views

NextJS Actioncable Proxy

So I'm trying to do two things at the same time and it's not going too well. I have a NextJS app and a Rails API server this app connects to. For authentication I'm using a JWT token stored in an http-...
  • 4,128
0 votes
0 answers
125 views

Error: Missing target element || Stimulus 1.1.1 Rails 6

I have this error 'Error: Missing target element' in console when i try to select one target. The main idea here is to iterate through an array of web_servers and select for each controllers, a target ...
  • 15
0 votes
0 answers
48 views

Simulate actioncable websocket receive in webdriverIo

Is there a way during webdriverio runtime to simulate an actioncable receive? I am using a fork of the package action-cable-react called actioncable-js-jwt for Rails actioncable js connections. Both ...
0 votes
1 answer
84 views

Why is Turbo Action Cable within a job not working in system Rspec tests?

I am building a project in Rails with Turbo and Action Cable. The project is working fine in development environment so far. However, my system test is the only thing that is not working. Surprisingly ...
0 votes
0 answers
90 views

How to insert after or before with Turbo::Broadcastable

I'm trying to insert something after a div using broadcast_append_to and i noticed that what I'm inserting it's appended inside the target div. Ex: index.html.erb: <%= turbo_stream_from "divs&...
  • 441
0 votes
1 answer
301 views

Upgrading from Rails 6 to 7: jquery-ujs and actioncable not working

I've just upgraded my Rails 6 app to Rails 7, and now my Javascript and ActionCable aren't working. After a bit of googling, I now know that this is because my app is set up to use sprockets with the ...
0 votes
0 answers
49 views

How to get connection count to a specific stream within ActionCable?

Background: I'm working on an app that has a JS frontend, and a Rails backend. I've been able to successfully create a vanilla JS websocket client, that properly connects to and receives broadcasts ...
0 votes
0 answers
74 views

Rails migrationg from ActionCable to AnyCable. Broadcast does not send a message

I`m trying to migrate from Actioncable to Anycable. This works perfect with action cable. But it does not work with any, looks like callback does not work. I saw in documentation that it probably ...
0 votes
0 answers
30 views

artillery not reporting request latency

I am running an artillery load test on a simple Rails ActiveCable app: config: target: "ws://localhost:3000/cable" phases: - duration: 10 # seconds arrivalRate: 1 # virtual ...
  • 999
0 votes
0 answers
33 views

How to redefine data format in ActionCable?

I'm using ActionCable for WebSocket communication in my Ruby on Rails project. The problem is it should coincide with certain preexisting message format which is different from ActionCable defaults. ...
  • 113
0 votes
0 answers
142 views

Action cable chatroom broadcast message data, only without html tags

I have created rails 7 app with action cable and active storage, I have created chat rooms where we can chat and with action cable I am sending messages I want to send only message data currently I am ...
1 vote
0 answers
96 views

Lightsail load balancer support WebSocket Secure (WSS)?

I am currently creating a monolithic application on Rail (7.0.3), have created a chat application using Action Cable and WebSocket communication. I am using LightSail, which is easy to build, but does ...
  • 33
4 votes
2 answers
348 views

Typing indicator with action cable in rails- 7

I am unable to add typing indicator in my rails app with action cable I have created app in rails 7 and I user trubo stream tag and broadcast in it so I did't used channel for live chat , I tried to ...
0 votes
0 answers
33 views

Elastic beanstalk rails app is returning nginx homepage

It is a rails app in elastic beanstalk, action cable is configured and we use webhooks to update data related to payments After using the app an error occurs, and it seems that autoscaling is done and ...
0 votes
1 answer
147 views

Websocket fails to start in ruby rails 7.0.4

I have been trying to set up an action cable with ruby on rails version 7.0.4 and fail to do In the app/channels/application_cable.rb my configuration file is as below. As per official documentation, ...
0 votes
0 answers
28 views

How can I get my my notification badge to stay visible in the navbar when the current page is refreshed or navigated away from?

This may be a dumb question but I've been staring at this for a few days. I can't get my head wrapped around ActionCable and I've been trying out some really hacky ways (eventListeners with ...
0 votes
1 answer
36 views

Reactjs with rails action cable state management

I am using action cables in rails. I have single cable in Reactjs. I am able to update compulSoryData state via dispatch under data.status == created condition but I am getting initial state of ...
  • 37
1 vote
0 answers
21 views

How to implement RoR ActionCable in flutter web?

How to implement RoR ActionCable in flutter web? I had tried and implemented ActionCable in flutter and its working fine in Mobile devices but not working in Web I had tried action_cable package in ...
3 votes
0 answers
264 views

turbo_stream_from suddenly stopped working

I'm running a rails 6 app that is heavily using all sorts of hotwire goodness. I noticed that after a deploy my turbo streams stopped working. In my view I've got <%= turbo_stream_from "#{...
  • 543
0 votes
0 answers
32 views

ruby on rails issue: action_cable.js:239 WebSocket connection to 'ws://103.166.185.90/cable' failed

I use ruby on rails and I want to use action_cable in my website but it only run on local, i don't know config it in my website. enter image description here I config in my production.rb here enter ...
0 votes
0 answers
32 views

Do all actioncable clients see messages in the same order?

I realize that actioncable doesn't guarantee messages are seen in sending order. But does it at least guarantee that all clients will see messages in the same order? I'm assuming it does since it ...
  • 1,998
1 vote
0 answers
61 views

Rails ActionCable: Is there a way to skip connection authentication for specific channels?

So I've looked at ActionCable Socket Without Authentication which doesn't quite fit my usecase. I have a standard connection class in Rails 7.0.3: module ApplicationCable class Connection < ...
1 vote
0 answers
125 views

Sharing a connection pool for all Rails uses of Redis

Summary: I'm using a single Redis instance for the Rails cache, actioncable and (non-cache) use in my rails code. Should all these uses share a single connection pool and if so how can I config this ...
  • 1,998
1 vote
1 answer
272 views

Rails: Broadcast message based on current_user (connection identifier)

Is there any way in action cable to modify the message being sent based on the user who established the connection (the conneciton is identified_by the current user). Specifically, I have a ...
  • 1,998
0 votes
1 answer
25 views

Rails: run controller action from actioncable

I have a rails SPA using react. I've recently started using actioncable. Since websockets have lower overhead than normal http connections I'd like to allow the javascript client to make requests ...
  • 1,998
0 votes
1 answer
195 views

actioncable: subscription to channel fails in production with ssl

jruby 9.3.6 (hence ruby 2.6.8), rails 6.1.6.1. in production using ssl (wss) with devise, puma, nginx. Locally actioncable is running without problems, but on the external server actioncable ...
  • 13
1 vote
1 answer
663 views

How to set up ActionCable with Importmaps in Rails 6? (MRI and Jruby)

Actioncable - an overview. I am using jruby 9.2.16 (hence ruby 2.5.7) with rails 6.1.6.1. I am not sure if only in development or only without ssl (wss) Actioncable can be used with the simple client ...
  • 13
1 vote
0 answers
110 views

find connected users in anycable

There are ways to find out how many users/connections are there for action cable as asked here previously How do I find out who is connected to ActionCable? and ActionCable - how to display number of ...
  • 3,118
0 votes
0 answers
148 views

Can not use this.$cable on setup function on vue3

Hi I tried to use actioncable-vue on vue3 project, https://github.com/mclintprojects/actioncable-vue, the problem with me that I can not use this.$cable on vue 3 setup. It always show undefined errors....
2 votes
1 answer
553 views

Ruby-on-Rails app using Action-Cable runs in development but fails in production mode

My RoR app uses Action-Cable to update the page when messages are received from a GPS receiver. This works fine in development mode, but the page updates are not received by the browser in production ...
0 votes
0 answers
91 views

How to send image using Action cable (Web socket)

I am using action_cable package. I am sending text message currently but also I need to send image as multipart file using action cable. I am getting error for below code. Sending as Base64 : ...
0 votes
0 answers
78 views

Action Cable in Sidekiq Worker production

Is it possible to broadcast using ActionCable from a background job using sidekiq? On development this works fine. In production my channels do not receive the broadcast. When I use Worker.new.perform(...
0 votes
0 answers
65 views

Active record's find_by return nil when there is valid record exist in database

I am facing one issue on production site, we using action cable, Sometime the below code inside the channel file not working when there is race condition. article = Article.find_by_name("cat"...
  • 37
0 votes
0 answers
40 views

In Rails whats the best way to pass parameters on-click to a controller for use in ActiveCable?

I am fairly new to Rails and am working on setting up a website with multiple buttons. When one user clicks a button, that button should change colors on all other users pages using ActionCable. I ...
0 votes
1 answer
248 views

"Subscription class not found" with ActionCable and Rails 6 API

I use ruby 3.0.2p107, Rails 6.1.6 and I've a Rails backend (API) and a React Typescript frontend. Backend code # app/channels/notification_channel.rb class NotificationChannel < ApplicationCable::...
0 votes
1 answer
156 views

Rails - Action cable : Broadcasting to specific resource

I am using action cable and rails 6. I am trying to broadcast messages to a particular organization. My client js code picks up the organization id on the page an creates a subscription on the ...
-1 votes
1 answer
131 views

How can i show only one item?

I have a chat on action cable. I change my show action for this: def show @rooms = Room.all render 'index' if @room = Room.find(params[:id]) else render 'new' end end But i need to ...
3 votes
1 answer
1k views

Ruby on Rails 7 Action Cable

I've upgraded from Rails 6 to 7 and now my action cable channels are not listening anymore. I'm sure it's a silly mistake but for the life of me I cannot track it down. app/javascript/channels/...
  • 111

1
2 3 4 5
17