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.

The Action Cable source is placed at Github.

To find code examples please check actioncable-examples repository.

849 questions
0
votes
1 answer

Download Exported excel file in the background with Action Cable

I need a way where I can send a request to server and get immediate response but I need to create long excel file in background when the background job is finished the created file should be downloaded automatically. I have follow this but here the…
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49
0
votes
1 answer

Rails: Action Cable saves only first record in database

I'm currently struggling to implement ActionCable into my application. The problem that I'm facing is that only the first message is saved into the databse and only the first message is updated in the view. Every message afterwards isn't saved into…
klasarn
  • 129
  • 1
  • 12
0
votes
1 answer

Running ActionCable behind Cloudfront

We've setup Cloudfront in front of our application, but unfortunately it strips the Upgrade header required for ActionCable to run. We'd like to have a different subdomain that points to the same servers, but bypasses Cloudfront (socket.site.com,…
0
votes
2 answers

Rails Action Cable: How can I access instance variables within ApplicationCable::Channel Class?

I would like to create chatrooms per product page so that uses can chat about the product while they are isolated from other products' discussions. For this purpose; I was planning to use @product instance varialbe while defining the subscriptions…
Tolga
  • 1,307
  • 3
  • 16
  • 31
0
votes
2 answers

Getting undefined local variable or method using Action Cable calling class method from model, rails

I am getting a error using action cable, NameError (undefined local variable or method `connections_info' for MicropostNotificationsChannel:Class): app/channels/micropost_notifications_channel.rb:12:in `notify' app/models/notification.rb:8:in…
Lee Eather
  • 345
  • 3
  • 16
0
votes
1 answer

Send zip binary data over ActionCable

An ActiveJob generates a zip in a Tempfile, reads its data to a variable, upon completion of the job, broadcasts the data, Base64 encoded, to the client, client downloads data via saveAs The end result can't be decompressed/is corrupted. I suspect…
0
votes
2 answers

Broadcasted message will not show up in browser console after being sent, actioncable and redis development env

I have got redis setup for windows running the server from redis cli C:\program files\redis>redis-cli 127.0.0.1:6379> Development cable.yml is development: adapter: redis url: redis://127.0.0.1:6379/0 Notifications channel rb class…
Lee Eather
  • 345
  • 3
  • 16
0
votes
0 answers

ActionCable using controller variable

In my Ruby on Rails project, I have a user model that is set up by devise. Each user belongs to an account with an account_id. In my application_controller.rb I have def set_account @account = current_user.account end This is working fine as in…
jl118
  • 307
  • 2
  • 16
0
votes
1 answer

How to broascast message to client not subcribe for a topic in Action Cable

I want to use Action Cable (Rails 5) to create a chat app. When the client signs in to the app, I send the message to subscribe for the channel. The channel will stream for connection based on current_user 's room_id. When the user sends a message…
lin
  • 1
  • 1
  • 2
0
votes
1 answer

React ActionCable Provider createConsumer function not working?

I am building an application and decided to utilize ActionCable for websockets. My goal is to keep track of each user in Actioncable so when they unsubscribe/close the window, I can remove them from a running list. There is no issue when the users…
Carl Reiser
  • 21
  • 1
  • 6
0
votes
1 answer

Action cable client for android

I want to subscribe to a specific channel of action cable. Any library or client of actioncable for android? I am using one library https://github.com/hosopy/actioncable-client-java but not able to connect with action cable.
0
votes
1 answer

actionCable of Rails5

In this tutorial I can understand almost of it. But only one part I can't. //javascripts/channels/rooms.coffee App.global_chat = App.cable.subscriptions.create { channel: "ChatRoomsChannel" chat_room_id: '' }, connected: -> # Called…
Champer Wu
  • 1,101
  • 3
  • 13
  • 32
0
votes
1 answer

Client-side shows data from the last user who connected when reload the page

I'm trying to create a "lobby" where you can join parties and the other user accepts who he wants from the list, i'm using ActionCable and Ruby on Rails The incomming requests shows the info from the last user connected on receiving data and must…
0
votes
3 answers

No route matches [POST] "/chat_rooms/1"

I am trying to make a direct messaging app using rails and I have been facing this problem whenever I try to send any message. When I submit the form it gives me this error: No route matches [POST] "/chat_rooms/1" my new.html.erb is: <%=…
0
votes
0 answers

Action Cable connection issue on rails 5.0.6

I'm following rails 5.0 guide to configure action cable but I'm getting error on action cable connection here are contents of application.js //= require cable //= require_tree ./cable I am getting following error. WebSocket connection to…
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49