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
0 answers

Action Cable Chat App works on local but not on deploy to Heroku

Just what the title says. Have finished the Learn Enough Action Cable tutorial and the app works great on the local server. When I deploy to heroku, however, it falls apart. Have to refresh the page for messages to show up. @notifications do not…
stevensonmt
  • 702
  • 1
  • 6
  • 19
0
votes
1 answer

How to implement "watching now" feature for a web page in Rails and actioncable

Assume for a chat room I would like to display for the user how many users are online at this moment(basically how many people watching now feature). What I thought of is using some redis counter for each actioncable channel, increment and decrement…
user1011792
0
votes
1 answer

ActionCable: unsubscribed - Reliable?

We are building an api where we do need to be able to see if a user is online or not. By using subscribed / unsubscribed we could achieve this pretty easy. But if connection is lost or severed in some way that does mean that either the client or…
Philip
  • 6,827
  • 13
  • 75
  • 104
0
votes
2 answers

Rails 5 - Cannot initialize ActionCable

I just upgraded my app to Rails 5, I'm following a tutorial about ActionCable basics, but I cannot start a server. Everytime I try to do so, I get the following error: uninitialized constant ActionCable (NameError) It seems like it comes from my…
Pierre Olivier Tran
  • 817
  • 1
  • 7
  • 15
0
votes
2 answers

SQLite3 exception in action cable

I'm trying to create notifications in rails 5 with action cable. Wondering if anyone could help with my troubles . Currently I have my notifications table Schema create_table "notifications", force: :cascade do |t| t.string "activity" …
leafshinobi25
  • 67
  • 2
  • 6
0
votes
1 answer

Action Cable notifications for multiple subscriptions

I'm trying to get a little red notifications circle to update dynamically in my Rails chat application using Action Cable. The problem is that sometimes when a message is sent, it seems to trigger the receive function more than once. I'm pretty…
0
votes
0 answers

get actioncable to work with vagrant

I did all the steps that are required to get action cable up and running, uncommenting cable lines, creating channels, installing redis ..etc but it all fails because of this line App.cable = ActionCable.createConsumer() I making invalid requests…
Medo
  • 335
  • 1
  • 3
  • 14
0
votes
2 answers

ActionCable - Respond With Error

With ActionCable, how can I respond with an error after receiving data from a client? For example, when the client fails to authenticate, ActionCable throws UnauthorizedError which responds with a 404. I want to respond with a 422, for example, when…
Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57
0
votes
1 answer

Get list of all registered connections

https://stackoverflow.com/a/36230416/5381547 https://stackoverflow.com/a/32945949/5381547 Those answers don't help me. I want to get a list of all registered connections to my ActionCable. I tried Redis.new.pubsub("channels", "action_cable/*")…
Viktor
  • 4,218
  • 4
  • 32
  • 63
0
votes
1 answer

WebRTC Error: Failed to create remote session description. Called in wrong state

I am trying to implement a real time audio/video group calls, but for now I want to get it for only two participants. It is not working and I don't understand why :( (actually when I test it with myself with two different accounts at the same time,…
Marta
  • 25
  • 2
  • 9
0
votes
2 answers

Pass data from index method of one controller to create of another

I generated a devise model User, and I also have a Conversation controller. I'm showing all users, except the logged in one, and I'm trying to create a new Conversation between user1 and user2, but I get redirected to the index method of the…
Bogdan Daniel
  • 2,689
  • 11
  • 43
  • 76
0
votes
1 answer

NoMethodError - undefined method `safe_constantize' for nil:NilClass

I am trying to create an ActionCable chatroom following the actioncable guide on GoRails.com. As I am trying to connect to ActionCable I get following error: NoMethodError - undefined method `safe_constantize' for nil:NilClass [ActionCable] [User 1]…
0
votes
1 answer

Karma, Rails preprocessing coffeescript erb files from gem dependencies

I have a karma test runner that dynamically writes rail's javascript files to a karma.conf.js file. Now, everything works (the tests run) if I remove actioncable's javascript files manually from the files list. However, when actioncable's files are…
0
votes
1 answer

Action Cable Allowed Request Origins regex

I am working with Rails 5 and Action Cable, trying to configure the allowed request origins option. I can't quite figure out how to generate the appropriate regex for what I need: http://*.ENV["APP_HOSTNAME"]:3000 Basically, I need to be able to…
Lorenz
  • 737
  • 1
  • 7
  • 26
0
votes
1 answer

ActionCable Messages loading after refresh page, but in console all is good

Have problem with ActionCable. I send messages, but can see it only after I refresh page. In console I see, that ActionCable work good: [ActionCable] [name10@nnnn.net] ChatsChannel is streaming from chats_1_channel [ActionCable] [name10@nnnn.net]…
ZhmAA
  • 1
  • 2